Apollo 10.0
自动驾驶开放平台
|
类 | |
class | GlobalData |
枚举 | |
enum | FileType { TYPE_FILE , TYPE_DIR } |
函数 | |
std::string | GetEnv (const std::string &var_name, const std::string &default_value="") |
const std::string | WorkRoot () |
bool | SetProtoToASCIIFile (const google::protobuf::Message &message, int file_descriptor) |
bool | SetProtoToASCIIFile (const google::protobuf::Message &message, const std::string &file_name) |
Sets the content of the file specified by the file_name to be the ascii representation of the input protobuf. | |
bool | SetStringToASCIIFile (const std::string &content, const std::string &file_name) |
Sets the content of the file specified by the file_name to be the ascii representation of the input string. | |
bool | GetProtoFromASCIIFile (const std::string &file_name, google::protobuf::Message *message) |
Parses the content of the file specified by the file_name as ascii representation of protobufs, and merges the parsed content to the proto. | |
bool | SetProtoToBinaryFile (const google::protobuf::Message &message, const std::string &file_name) |
Sets the content of the file specified by the file_name to be the binary representation of the input protobuf. | |
bool | GetProtoFromBinaryFile (const std::string &file_name, google::protobuf::Message *message) |
Parses the content of the file specified by the file_name as binary representation of protobufs, and merges the parsed content to the proto. | |
bool | GetProtoFromFile (const std::string &file_name, google::protobuf::Message *message) |
Parses the content of the file specified by the file_name as a representation of protobufs, and merges the parsed content to the proto. | |
bool | GetProtoFromJsonFile (const std::string &file_name, google::protobuf::Message *message) |
Parses the content of the json file specified by the file_name as ascii representation of protobufs, and merges the parsed content to the proto. | |
bool | GetContent (const std::string &file_name, std::string *content) |
Get file content as string. | |
std::string | GetAbsolutePath (const std::string &prefix, const std::string &relative_path) |
Get absolute path by concatenating prefix and relative_path. | |
bool | PathExists (const std::string &path) |
Check if the path exists. | |
bool | PathIsAbsolute (const std::string &path) |
bool | DirectoryExists (const std::string &directory_path) |
Check if the directory specified by directory_path exists and is indeed a directory. | |
std::vector< std::string > | Glob (const std::string &pattern) |
Expand path pattern to matched paths. | |
bool | CopyFile (const std::string &from, const std::string &to) |
Copy a file. | |
bool | IsValidPath (const std::string &path) |
bool | CopyDir (const std::string &from, const std::string &to) |
Copy a directory. | |
bool | Copy (const std::string &from, const std::string &to) |
Copy a file or directory. | |
bool | EnsureDirectory (const std::string &directory_path) |
Check if a specified directory specified by directory_path exists. | |
bool | RemoveAllFiles (const std::string &directory_path) |
Remove all the files under a specified directory. | |
std::vector< std::string > | ListSubPaths (const std::string &directory_path, const unsigned char d_type=DT_DIR) |
List sub-paths. | |
size_t | FindPathByPattern (const std::string &base_path, const std::string &patt, const unsigned char d_type, const bool recursive, std::vector< std::string > *result_list) |
Find path with pattern | |
std::string | GetDirName (const std::string &path) |
get directory name of path | |
std::string | GetFileName (const std::string &path, const bool remove_extension) |
bool | GetFilePathWithEnv (const std::string &path, const std::string &env_var, std::string *file_path) |
get file path, judgement priority: | |
std::string | GetCurrentPath () |
bool | GetType (const string &filename, FileType *type) |
bool | DeleteFile (const string &filename) |
bool | CreateDir (const string &dir) |
bool | DeleteFile (const std::string &filename) |
bool | GetType (const std::string &filename, FileType *type) |
bool | CreateDir (const std::string &dir) |
template<typename T > | |
bool | LoadConfig (const std::string &relative_path, T *config) |
template<typename T > | |
T | UnixToGpsSeconds (T unix_seconds) |
int64_t | UnixToGpsMicroseconds (int64_t unix_microseconds) |
int64_t | UnixToGpsNanoseconds (int64_t unix_nanoseconds) |
template<typename T > | |
T | GpsToUnixSeconds (T gps_seconds) |
int64_t | GpsToUnixMicroseconds (int64_t gps_microseconds) |
int64_t | GpsToUnixNanoseconds (int64_t gps_nanoseconds) |
uint64_t | GpsToUnixMicroseconds (uint64_t gps_microseconds) |
uint64_t | GpsToUnixNanoseconds (uint64_t gps_nanoseconds) |
uint64_t | StringToUnixSeconds (const std::string &time_str, const std::string &format_str="%Y-%m-%d %H:%M:%S") |
std::string | UnixSecondsToString (uint64_t unix_seconds, const std::string &format_str="%Y-%m-%d-%H:%M:%S") |
std::size_t | Hash (const std::string &key) |
template<typename Enum > | |
auto | ToInt (Enum const value) -> typename std::underlying_type< Enum >::type |
变量 | |
constexpr int32_t | UNIX_GPS_DIFF = 315964800 |
constexpr int64_t | ONE_MILLION = 1000000L |
constexpr int64_t | ONE_BILLION = 1000000000L |
bool apollo::cyber::common::Copy | ( | const std::string & | from, |
const std::string & | to | ||
) |
Copy a file or directory.
from | The path to copy from. |
to | The path to copy to. |
bool apollo::cyber::common::CopyDir | ( | const std::string & | from, |
const std::string & | to | ||
) |
Copy a directory.
from | The path to copy from. |
to | The path to copy to. |
bool apollo::cyber::common::CopyFile | ( | const std::string & | from, |
const std::string & | to | ||
) |
Copy a file.
from | The file path to copy from. |
to | The file path to copy to. |
bool apollo::cyber::common::CreateDir | ( | const std::string & | dir | ) |
bool apollo::cyber::common::CreateDir | ( | const string & | dir | ) |
bool apollo::cyber::common::DeleteFile | ( | const std::string & | filename | ) |
bool apollo::cyber::common::DeleteFile | ( | const string & | filename | ) |
bool apollo::cyber::common::DirectoryExists | ( | const std::string & | directory_path | ) |
Check if the directory specified by directory_path exists and is indeed a directory.
directory_path | Directory path. |
bool apollo::cyber::common::EnsureDirectory | ( | const std::string & | directory_path | ) |
Check if a specified directory specified by directory_path exists.
If not, recursively create the directory (and its parents).
directory_path | Directory path. |
size_t apollo::cyber::common::FindPathByPattern | ( | const std::string & | base_path, |
const std::string & | patt, | ||
const unsigned char | d_type, | ||
const bool | recursive, | ||
std::vector< std::string > * | result_list | ||
) |
Find path with pattern
base_path | search root |
patt | pattern to compare with entry->d_name for filter |
d_type | entry type for filter |
recursive | search directory recursively |
result_list | a vector reference for storing the search result |
std::string apollo::cyber::common::GetAbsolutePath | ( | const std::string & | prefix, |
const std::string & | relative_path | ||
) |
Get absolute path by concatenating prefix and relative_path.
bool apollo::cyber::common::GetContent | ( | const std::string & | file_name, |
std::string * | content | ||
) |
Get file content as string.
file_name | The name of the file to read content. |
content | The file content. |
std::string apollo::cyber::common::GetCurrentPath | ( | ) |
std::string apollo::cyber::common::GetDirName | ( | const std::string & | path | ) |
|
inline |
在文件 environment.h 第 29 行定义.
std::string apollo::cyber::common::GetFileName | ( | const std::string & | path, |
const bool | remove_extension | ||
) |
bool apollo::cyber::common::GetFilePathWithEnv | ( | const std::string & | path, |
const std::string & | env_var, | ||
std::string * | file_path | ||
) |
get file path, judgement priority:
path | input file path string. |
env_var | environment var string. |
file_path | the output file path. |
bool apollo::cyber::common::GetProtoFromASCIIFile | ( | const std::string & | file_name, |
google::protobuf::Message * | message | ||
) |
Parses the content of the file specified by the file_name as ascii representation of protobufs, and merges the parsed content to the proto.
file_name | The name of the file to parse whose content. |
message | The proto to carry the parsed content in the specified file. |
bool apollo::cyber::common::GetProtoFromBinaryFile | ( | const std::string & | file_name, |
google::protobuf::Message * | message | ||
) |
Parses the content of the file specified by the file_name as binary representation of protobufs, and merges the parsed content to the proto.
file_name | The name of the file to parse whose content. |
message | The proto to carry the parsed content in the specified file. |
bool apollo::cyber::common::GetProtoFromFile | ( | const std::string & | file_name, |
google::protobuf::Message * | message | ||
) |
Parses the content of the file specified by the file_name as a representation of protobufs, and merges the parsed content to the proto.
file_name | The name of the file to parse whose content. |
message | The proto to carry the parsed content in the specified file. |
bool apollo::cyber::common::GetProtoFromJsonFile | ( | const std::string & | file_name, |
google::protobuf::Message * | message | ||
) |
Parses the content of the json file specified by the file_name as ascii representation of protobufs, and merges the parsed content to the proto.
file_name | The name of the file to parse whose content. |
message | The proto to carry the parsed content in the specified file. |
bool apollo::cyber::common::GetType | ( | const std::string & | filename, |
FileType * | type | ||
) |
bool apollo::cyber::common::GetType | ( | const string & | filename, |
FileType * | type | ||
) |
std::vector< std::string > apollo::cyber::common::Glob | ( | const std::string & | pattern | ) |
Expand path pattern to matched paths.
pattern | Path pattern, which may contain wildcards [?*]. |
|
inline |
在文件 time_conversion.h 第 95 行定义.
|
inline |
在文件 time_conversion.h 第 105 行定义.
|
inline |
在文件 time_conversion.h 第 100 行定义.
|
inline |
在文件 time_conversion.h 第 110 行定义.
T apollo::cyber::common::GpsToUnixSeconds | ( | T | gps_seconds | ) |
在文件 time_conversion.h 第 85 行定义.
|
inline |
bool apollo::cyber::common::IsValidPath | ( | const std::string & | path | ) |
std::vector< std::string > apollo::cyber::common::ListSubPaths | ( | const std::string & | directory_path, |
const unsigned char | d_type = DT_DIR |
||
) |
List sub-paths.
directory_path | Directory path. |
d_type | Sub-path type, DT_DIR for directory, or DT_REG for file. |
bool apollo::cyber::common::LoadConfig | ( | const std::string & | relative_path, |
T * | config | ||
) |
bool apollo::cyber::common::PathExists | ( | const std::string & | path | ) |
bool apollo::cyber::common::PathIsAbsolute | ( | const std::string & | path | ) |
bool apollo::cyber::common::RemoveAllFiles | ( | const std::string & | directory_path | ) |
Remove all the files under a specified directory.
Note that sub-directories are NOT affected.
directory_path | Directory path. |
bool apollo::cyber::common::SetProtoToASCIIFile | ( | const google::protobuf::Message & | message, |
const std::string & | file_name | ||
) |
Sets the content of the file specified by the file_name to be the ascii representation of the input protobuf.
message | The proto to output to the specified file. |
file_name | The name of the target file to set the content. |
bool apollo::cyber::common::SetProtoToASCIIFile | ( | const google::protobuf::Message & | message, |
int | file_descriptor | ||
) |
bool apollo::cyber::common::SetProtoToBinaryFile | ( | const google::protobuf::Message & | message, |
const std::string & | file_name | ||
) |
Sets the content of the file specified by the file_name to be the binary representation of the input protobuf.
message | The proto to output to the specified file. |
file_name | The name of the target file to set the content. |
bool apollo::cyber::common::SetStringToASCIIFile | ( | const std::string & | content, |
const std::string & | file_name | ||
) |
Sets the content of the file specified by the file_name to be the ascii representation of the input string.
content | The string to output to the specified file. |
file_name | The name of the target file to set the content. |
|
inline |
在文件 time_conversion.h 第 115 行定义.
auto apollo::cyber::common::ToInt | ( | Enum const | value | ) | -> typename std::underlying_type<Enum>::type |
|
inline |
在文件 time_conversion.h 第 125 行定义.
|
inline |
在文件 time_conversion.h 第 74 行定义.
|
inline |
在文件 time_conversion.h 第 79 行定义.
T apollo::cyber::common::UnixToGpsSeconds | ( | T | unix_seconds | ) |
在文件 time_conversion.h 第 65 行定义.
|
inline |
在文件 environment.h 第 40 行定义.
|
constexpr |
在文件 time_conversion.h 第 62 行定义.
|
constexpr |
在文件 time_conversion.h 第 60 行定义.
|
constexpr |
在文件 time_conversion.h 第 58 行定义.