16 namespace filesystem {
69 bool Copy(
const std::string &src_path,
const std::string &dst_path);
74 std::vector<std::string> &subdirs,
75 std::vector<std::string> &filenames);
78 std::vector<std::string> &filenames);
81 const std::string &extname,
82 std::vector<std::string> &filenames);
85 const std::string &directory,
86 std::function<
bool(
const std::string &)> is_match);
89 FILE *
FOpen(
const std::string &filename,
const std::string &
mode);
92 std::vector<char> &
bytes,
93 std::string *errorStr);
95 std::string
JoinPath(
const std::vector<std::string> &path_components);
97 std::string
JoinPath(
const std::string &path_component1,
98 const std::string &path_component2);
100 std::string
AddIfExist(
const std::string &path,
101 const std::vector<std::string> &folder_names);
119 bool Open(
const std::string &filename,
const std::string &
mode);
155 size_t ReadData(
void *
data,
size_t elem_size,
size_t num_elems);
161 FILE *file_ =
nullptr;
163 std::vector<char> line_buffer_;
void * bytes
Definition: TriangleMeshBuffers.cpp:158
Definition: FileSystem.h:113
~CFile()
The destructor closes the file automatically.
Definition: FileSystem.cpp:512
int64_t CurPos()
Returns current position in the file (ftell).
Definition: FileSystem.cpp:535
bool Open(const std::string &filename, const std::string &mode)
Open a file.
Definition: FileSystem.cpp:514
size_t ReadData(T *data, size_t num_elems)
Definition: FileSystem.h:147
void Close()
Close the file.
Definition: FileSystem.cpp:525
std::string GetError()
Returns the last encountered error for this file.
Definition: FileSystem.cpp:523
int64_t GetNumLines()
Returns the number of lines in the file.
Definition: FileSystem.cpp:568
FILE * GetFILE()
Returns the underlying C FILE pointer.
Definition: FileSystem.h:158
int64_t GetFileSize()
Returns the file size in bytes.
Definition: FileSystem.cpp:547
const char * ReadLine()
Definition: FileSystem.cpp:595
const char const char value recording_handle imu_sample recording_handle uint8_t data
Definition: K4aPlugin.cpp:269
const char const char value recording_handle imu_sample recording_handle uint8_t size_t data_size k4a_record_configuration_t config target_format k4a_capture_t capture_handle k4a_imu_sample_t imu_sample playback_handle k4a_logging_message_cb_t void min_level device_handle k4a_imu_sample_t timeout_in_ms capture_handle capture_handle capture_handle image_handle temperature_c k4a_image_t image_handle uint8_t image_handle image_handle image_handle image_handle image_handle timestamp_usec white_balance image_handle k4a_device_configuration_t config device_handle char size_t serial_number_size bool int32_t int32_t int32_t int32_t k4a_color_control_mode_t default_mode mode
Definition: K4aPlugin.cpp:678
bool ChangeWorkingDirectory(const std::string &directory)
Definition: FileSystem.cpp:221
std::string GetFileNameWithoutDirectory(const std::string &filename)
Definition: FileSystem.cpp:107
std::string GetTempDirectoryPath()
Definition: FileSystem.cpp:217
std::string GetFileExtensionInLowerCase(const std::string &filename)
Definition: FileSystem.cpp:87
bool RemoveFile(const std::string &filename)
Definition: FileSystem.cpp:289
bool MakeDirectory(const std::string &directory)
Definition: FileSystem.cpp:236
bool ListDirectory(const std::string &directory, std::vector< std::string > &subdirs, std::vector< std::string > &filenames)
Definition: FileSystem.cpp:293
std::string GetHomeDirectory()
Get the HOME directory for the user.
Definition: FileSystem.cpp:55
std::string JoinPath(const std::string &path_component1, const std::string &path_component2)
Definition: FileSystem.cpp:487
std::string GetFileNameWithoutExtension(const std::string &filename)
Definition: FileSystem.cpp:101
std::vector< std::string > GetPathComponents(const std::string &path)
Definition: FileSystem.cpp:142
FILE * FOpen(const std::string &filename, const std::string &mode)
Definition: FileSystem.cpp:370
bool DeleteDirectory(const std::string &directory)
Definition: FileSystem.cpp:259
bool ListFilesInDirectoryWithExtension(const std::string &directory, const std::string &extname, std::vector< std::string > &filenames)
Definition: FileSystem.cpp:328
std::string AddIfExist(const std::string &path, const std::vector< std::string > &folder_names)
Definition: FileSystem.cpp:501
bool DirectoryExists(const std::string &directory)
Definition: FileSystem.cpp:225
bool FileExists(const std::string &filename)
Definition: FileSystem.cpp:269
std::string GetFileParentDirectory(const std::string &filename)
Definition: FileSystem.cpp:116
bool DirectoryIsEmpty(const std::string &directory)
Definition: FileSystem.cpp:229
bool Copy(const std::string &src_path, const std::string &dst_path)
Definition: FileSystem.cpp:276
bool MakeDirectoryHierarchy(const std::string &directory)
Definition: FileSystem.cpp:244
std::string GetWorkingDirectory()
Definition: FileSystem.cpp:135
std::string GetRegularizedDirectoryName(const std::string &directory)
Definition: FileSystem.cpp:125
bool FReadToBuffer(const std::string &path, std::vector< char > &bytes, std::string *errorStr)
Definition: FileSystem.cpp:439
std::vector< std::string > FindFilesRecursively(const std::string &directory, std::function< bool(const std::string &)> is_match)
Definition: FileSystem.cpp:347
bool ListFilesInDirectory(const std::string &directory, std::vector< std::string > &filenames)
Definition: FileSystem.cpp:322
std::string GetIOErrorString(const int errnoVal)
Definition: FileSystem.cpp:388
Definition: PinholeCameraIntrinsic.cpp:16