Apollo  6.0
Open source self driving car software
system_utility.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2017 The Apollo Authors. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *****************************************************************************/
16 
17 #pragma once
18 
19 #include <string>
20 #include <vector>
21 
22 namespace apollo {
23 namespace localization {
24 namespace msf {
25 
26 class system {
27  public:
29  static bool IsExists(const std::string& path);
31  static bool IsDirectory(const std::string& path);
33  static bool CreateDirectory(const std::string& path);
35  static bool GetFileSize(const std::string& path, unsigned int* size);
37  static bool CopyFile(const std::string& src, const std::string& dst,
38  bool is_overwrite = true);
41  static void GetFilesInFolderRecursive(const std::string& folder,
42  const std::string& ext,
43  std::vector<std::string>* ret);
46  static void GetFilesInFolder(const std::string& folder,
47  const std::string& ext,
48  std::vector<std::string>* ret);
50  static void GetFoldersInFolder(const std::string& folder,
51  std::vector<std::string>* ret);
52 };
53 
54 } // namespace msf
55 } // namespace localization
56 } // namespace apollo
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
static bool IsExists(const std::string &path)
Determine if the file or directory exists.
static bool GetFileSize(const std::string &path, unsigned int *size)
Get the size of a file.
static bool CreateDirectory(const std::string &path)
Try to create a directory.
static bool CopyFile(const std::string &src, const std::string &dst, bool is_overwrite=true)
Copy the file.
static void GetFilesInFolderRecursive(const std::string &folder, const std::string &ext, std::vector< std::string > *ret)
get list of files end with ext in folder.
static bool IsDirectory(const std::string &path)
Determine if the path is a directory.
Definition: system_utility.h:26
static void GetFoldersInFolder(const std::string &folder, std::vector< std::string > *ret)
Get list of folders in folder.
static void GetFilesInFolder(const std::string &folder, const std::string &ext, std::vector< std::string > *ret)
get list of files end with ext in folder.