Skip to content

File utils.h

FileList > src > utils > utils.h

Go to the source code of this file

  • #include <opencv2/opencv.hpp>
  • #include <string>
  • #include <iostream>
  • #include <filesystem>
  • #include <sys/stat.h>
  • #include <ctime>
  • #include <sstream>
  • #include "AIAC/Log.h"
  • #include "glm/glm.hpp"

Public Functions

Type Name
void CopyFile (const std::string & source, const std::string & destination)
Copy the file from source to destination.
std::string GetCurrentDateTime ()
Get current date/time, format is YYYY-MM-DD.HH:mm.
long GetCurrentTimestamp ()
Get current timestamp in milliseconds.
std::string GetFileNameFromPath (const std::string & path, bool withExtension=true)
Get the name of the file from the given path.
std::vector< std::string > GetFilePaths (const std::string & dirPath, const std::string & extension)
Get all file paths with the given extension in the given directory.
std::vector< std::string > GetFolderPaths (const std::string & dirPath)
Get all sub-folders' paths in the given directory.
bool IsFileExist (const std::string & name)
Check if the given file exists.
std::vector< std::string > ParseConfigFile (const std::string & configPath, const std::string & entryName)
Parse the config file and get the file paths.

Public Functions Documentation

function CopyFile

Copy the file from source to destination.

inline void CopyFile (
    const std::string & source,
    const std::string & destination
) 

Parameters:

  • source the source file path
  • destination the destination file path

function GetCurrentDateTime

Get current date/time, format is YYYY-MM-DD.HH:mm.

inline std::string GetCurrentDateTime () 


function GetCurrentTimestamp

Get current timestamp in milliseconds.

inline long GetCurrentTimestamp () 


function GetFileNameFromPath

Get the name of the file from the given path.

inline std::string GetFileNameFromPath (
    const std::string & path,
    bool withExtension=true
) 


function GetFilePaths

Get all file paths with the given extension in the given directory.

inline std::vector< std::string > GetFilePaths (
    const std::string & dirPath,
    const std::string & extension
) 

Parameters:

  • dirPath
  • extension

function GetFolderPaths

Get all sub-folders' paths in the given directory.

inline std::vector< std::string > GetFolderPaths (
    const std::string & dirPath
) 

Parameters:

  • folderPath

function IsFileExist

Check if the given file exists.

inline bool IsFileExist (
    const std::string & name
) 

Parameters:

  • name

function ParseConfigFile

Parse the config file and get the file paths.

inline std::vector< std::string > ParseConfigFile (
    const std::string & configPath,
    const std::string & entryName
) 

Parameters:

  • configPath
  • entryName


The documentation for this class was generated from the following file src/utils/utils.h