Lunchbox  1.13.0
Multi-threaded C++ toolbox library for all application developers creating high-performance multi-threaded programs.
file.h
1 
2 /* Copyright (c) 2009-2015, Cedric Stalder <cedric.stalder@gmail.com>
3  * Stefan Eilemann <eile@equalizergraphics.com>
4  * Daniel Nachbaur <danielnachbaur@gmail.com>
5  *
6  * This library is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License version 2.1 as published
8  * by the Free Software Foundation.
9  *
10  * This library is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13  * details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this library; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef LUNCHBOX_FILE_H
21 #define LUNCHBOX_FILE_H
22 
23 #include <lunchbox/api.h>
24 #include <lunchbox/compiler.h>
25 #include <lunchbox/types.h>
26 
27 namespace lunchbox
28 {
29 
38 LUNCHBOX_API Strings searchDirectory( const std::string& directory,
39  const std::string& pattern );
40 // LB_DEPRECATED;
41 
46 LUNCHBOX_API std::string getFilename( const std::string& filename );
47 // LB_DEPRECATED;
48 
53 LUNCHBOX_API std::string getDirname( const std::string& filename )
54  LB_DEPRECATED;
55 
65 LUNCHBOX_API std::string getExecutablePath();
66 
81 LUNCHBOX_API std::string getRootPath();
82 
87 LUNCHBOX_API std::string getLibraryPath();
88 
93 LUNCHBOX_API Strings getLibraryPaths();
94 
96 LUNCHBOX_API bool saveBinary( const servus::Serializable& object,
97  const std::string& filename );
98 
100 LUNCHBOX_API bool loadBinary( servus::Serializable& object,
101  const std::string& filename );
102 
104 LUNCHBOX_API bool saveAscii( const servus::Serializable& object,
105  const std::string& filename );
106 
108 LUNCHBOX_API bool loadAscii( servus::Serializable& object,
109  const std::string& filename );
110 }
111 
112 #endif //LUNCHBOX_FILE_H
bool loadAscii(servus::Serializable &object, const std::string &filename)
Load from ascii (JSON) file.
Defines export visibility macros for library Lunchbox.
Basic type definitions not provided by the operating system.
bool loadBinary(servus::Serializable &object, const std::string &filename)
Load from binary file.
std::vector< std::string > Strings
A vector of std::strings.
Definition: types.h:215
Strings searchDirectory(const std::string &directory, const std::string &pattern)
Retrieve a list of files in a directory matching a boost::regex pattern.
std::string getExecutablePath()
Get the absolute path to the current executable.
std::string getRootPath()
Get the absolute path to the root path of the current executable.
bool saveBinary(const servus::Serializable &object, const std::string &filename)
Save binary to file.
std::string getLibraryPath()
Abstraction layer and common utilities for multi-threaded programming.
Definition: algorithm.h:32
Strings getLibraryPaths()
bool saveAscii(const servus::Serializable &object, const std::string &filename)
Save ascii (JSON) to file.
std::string getFilename(const std::string &filename)
std::string getDirname(const std::string &filename) LB_DEPRECATED