Apollo 10.0
自动驾驶开放平台
file.cc 文件参考
#include "cyber/common/file.h"
#include <dirent.h>
#include <fcntl.h>
#include <glob.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <cerrno>
#include <cstddef>
#include <fstream>
#include <string>
#include "google/protobuf/util/json_util.h"
#include "nlohmann/json.hpp"
file.cc 的引用(Include)关系图:

浏览源代码.

命名空间

namespace  apollo
 class register implement
 
namespace  apollo::cyber
 
namespace  apollo::cyber::common
 

函数

bool apollo::cyber::common::SetProtoToASCIIFile (const google::protobuf::Message &message, int file_descriptor)
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
bool apollo::cyber::common::GetContent (const std::string &file_name, std::string *content)
 Get file content as string.
 
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::PathExists (const std::string &path)
 Check if the path exists.
 
bool apollo::cyber::common::PathIsAbsolute (const std::string &path)
 
bool apollo::cyber::common::DirectoryExists (const std::string &directory_path)
 Check if the directory specified by directory_path exists and is indeed a directory.
 
std::vector< std::string > apollo::cyber::common::Glob (const std::string &pattern)
 Expand path pattern to matched paths.
 
bool apollo::cyber::common::CopyFile (const std::string &from, const std::string &to)
 Copy a file.
 
bool apollo::cyber::common::IsValidPath (const std::string &path)
 
bool apollo::cyber::common::CopyDir (const std::string &from, const std::string &to)
 Copy a directory.
 
bool apollo::cyber::common::Copy (const std::string &from, const std::string &to)
 Copy a file or directory.
 
bool apollo::cyber::common::EnsureDirectory (const std::string &directory_path)
 Check if a specified directory specified by directory_path exists.
 
bool apollo::cyber::common::RemoveAllFiles (const std::string &directory_path)
 Remove all the files under a specified directory.
 
std::vector< std::string > apollo::cyber::common::ListSubPaths (const std::string &directory_path, const unsigned char d_type=DT_DIR)
 List sub-paths.
 
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
 
std::string apollo::cyber::common::GetDirName (const std::string &path)
 get directory name of path
 
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:
 
std::string apollo::cyber::common::GetCurrentPath ()
 
bool apollo::cyber::common::GetType (const string &filename, FileType *type)
 
bool apollo::cyber::common::DeleteFile (const string &filename)
 
bool apollo::cyber::common::CreateDir (const string &dir)