A Discrete-Event Network Simulator
API
system-path.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2008 INRIA
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19  */
20 #ifndef SYSTEM_PATH_H
21 #define SYSTEM_PATH_H
22 
23 #include <string>
24 #include <list>
25 
32 namespace ns3 {
33 
48 namespace SystemPath {
49 
56 std::string FindSelfDirectory (void);
57 
66 std::string Append (std::string left, std::string right);
67 
80 std::list<std::string> Split (std::string path);
81 
93 std::string Join (std::list<std::string>::const_iterator begin,
94  std::list<std::string>::const_iterator end);
95 
103 std::list<std::string> ReadFiles (std::string path);
104 
131 std::string MakeTemporaryDirectoryName (void);
132 
139 void MakeDirectories (std::string path);
140 
148 bool Exists (const std::string path);
149 
150 } // namespace SystemPath
151 
152 
153 } // namespace ns3
154 
155 
156 #endif /* SYSTEM_PATH_H */
std::list< std::string > ReadFiles(std::string path)
Get the list of files located in a file system directory.
Definition: system-path.cc:300
std::string MakeTemporaryDirectoryName(void)
Get the name of a temporary directory.
Definition: system-path.cc:314
bool Exists(const std::string path)
Check if a path exists.
Definition: system-path.cc:393
std::list< std::string > Split(std::string path)
Split a file system path into directories according to the local path separator.
Definition: system-path.cc:258
void MakeDirectories(std::string path)
Create all the directories leading to path.
Definition: system-path.cc:361
std::string Append(std::string left, std::string right)
Join two file system path elements.
Definition: system-path.cc:241
std::string Join(std::list< std::string >::const_iterator begin, std::list< std::string >::const_iterator end)
Join a list of file system path directories into a single file system path.
Definition: system-path.cc:276
std::string FindSelfDirectory(void)
Get the file system path to the current executable.
Definition: system-path.cc:150
Every class exported by the ns3 library is enclosed in the ns3 namespace.