2020-12-26 14:12:05 -08:00
|
|
|
// Copyright (c) FIRST and other WPILib contributors.
|
|
|
|
|
// Open Source Software; you can modify and/or share it under the terms of
|
|
|
|
|
// the WPILib BSD license file in the root directory of this project.
|
2018-11-03 04:16:44 +08:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2021-06-01 21:50:35 -07:00
|
|
|
#include <string>
|
2018-11-03 04:16:44 +08:00
|
|
|
|
2019-02-02 00:20:57 -08:00
|
|
|
/** WPILib FileSystem namespace */
|
2020-12-28 01:19:59 -08:00
|
|
|
namespace frc::filesystem {
|
2018-11-03 04:16:44 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Obtains the current working path that the program was launched with.
|
|
|
|
|
* This is analogous to the `pwd` command on unix.
|
|
|
|
|
*
|
2021-06-01 21:50:35 -07:00
|
|
|
* @return The result of the current working path lookup.
|
2018-11-03 04:16:44 +08:00
|
|
|
*/
|
2021-06-01 21:50:35 -07:00
|
|
|
std::string GetLaunchDirectory();
|
2018-11-03 04:16:44 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Obtains the operating directory of the program. On the roboRIO, this
|
|
|
|
|
* is /home/lvuser. In simulation, it is where the simulation was launched
|
|
|
|
|
* from (`pwd`).
|
|
|
|
|
*
|
2021-06-01 21:50:35 -07:00
|
|
|
* @return The result of the operating directory lookup.
|
2018-11-03 04:16:44 +08:00
|
|
|
*/
|
2021-06-01 21:50:35 -07:00
|
|
|
std::string GetOperatingDirectory();
|
2018-11-03 04:16:44 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Obtains the deploy directory of the program, which is the remote location
|
|
|
|
|
* src/main/deploy is deployed to by default. On the roboRIO, this is
|
|
|
|
|
* /home/lvuser/deploy. In simulation, it is where the simulation was launched
|
2020-01-19 16:34:45 -08:00
|
|
|
* from, in the subdirectory "src/main/deploy" (`pwd`/src/main/deploy).
|
2018-11-03 04:16:44 +08:00
|
|
|
*
|
2021-06-01 21:50:35 -07:00
|
|
|
* @return The result of the operating directory lookup
|
2018-11-03 04:16:44 +08:00
|
|
|
*/
|
2021-06-01 21:50:35 -07:00
|
|
|
std::string GetDeployDirectory();
|
2018-11-03 04:16:44 +08:00
|
|
|
|
2020-12-28 01:19:59 -08:00
|
|
|
} // namespace frc::filesystem
|