Apollo 11.0
自动驾驶开放平台
system_utility.h
浏览该文件的文档.
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
22namespace apollo {
23namespace localization {
24namespace msf {
25
26class 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
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 GetFilesInFolder(const std::string &folder, const std::string &ext, std::vector< std::string > *ret)
get list of files end with ext in folder.
static void GetFoldersInFolder(const std::string &folder, std::vector< std::string > *ret)
Get list of folders in folder.
static bool IsExists(const std::string &path)
Determine if the file or directory exists.
static bool IsDirectory(const std::string &path)
Determine if the path is a directory.
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.
class register implement
Definition arena_queue.h:37