Menu

[94f52a]: / filesystem / current_directory.hpp  Maximize  Restore  History

Download this file

24 lines (16 with data), 482 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef CHILON_FILESYSTEM_CURRENT_DIRECTORY_HPP
#define CHILON_FILESYSTEM_CURRENT_DIRECTORY_HPP
#include <chilon/cstring.hpp>
#include <unistd.h>
#include <string>
namespace chilon { namespace filesystem {
/**
* Represents the current directory.
*/
struct current_directory : cstring_allocated {
char const * path() const { return str(); }
bool good() const { return ! empty(); }
current_directory() : cstring_allocated(::getcwd(0, 0)) {}
};
} }
#endif
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.