Unverified Commit 6ef3723c authored by Mark Lindner's avatar Mark Lindner Committed by GitHub

Merge pull request #117 from xyproto/add-readFile-writeFile-signatures

Add inline functions for readFile and writeFile for std::string
parents f9dd22b5 1c4a4374
...@@ -1451,13 +1451,18 @@ The @code{write()} method writes the configuration to the given @var{stream}. ...@@ -1451,13 +1451,18 @@ The @code{write()} method writes the configuration to the given @var{stream}.
@end deftypemethod @end deftypemethod
@deftypemethod Config void readFile (@w{const char * @var{filename}}) @deftypemethod Config void readFile (@w{const char * @var{filename}})
@deftypemethodx Config void writeFile (@w{const char * @var{filename}}) const @deftypemethodx Config void readFile (@w{const std::string &@var{filename}})
The @code{readFile()} method reads and parses a configuration from the The @code{readFile()} method reads and parses a configuration from the
file named @var{filename}. A @code{ParseException} is thrown if a file named @var{filename}. A @code{ParseException} is thrown if a
parse error occurs. A @code{FileIOException} is thrown if the file parse error occurs. A @code{FileIOException} is thrown if the file
cannot be read. cannot be read.
@end deftypemethod
@deftypemethod Config void writeFile (@w{const char * @var{filename}})
@deftypemethodx Config void writeFile (@w{const std::string &@var{filename}})
The @code{writeFile()} method writes the configuration to the file The @code{writeFile()} method writes the configuration to the file
named @var{filename}. A @code{FileIOException} is thrown if the file cannot named @var{filename}. A @code{FileIOException} is thrown if the file cannot
be written. be written.
......
...@@ -492,7 +492,12 @@ class LIBCONFIGXX_API Config ...@@ -492,7 +492,12 @@ class LIBCONFIGXX_API Config
{ return(readString(str.c_str())); } { return(readString(str.c_str())); }
void readFile(const char *filename); void readFile(const char *filename);
inline void readFile(const std::string &filename)
{ readFile(filename.c_str()); }
void writeFile(const char *filename); void writeFile(const char *filename);
inline void writeFile(const std::string &filename)
{ writeFile(filename.c_str()); }
Setting & lookup(const char *path) const; Setting & lookup(const char *path) const;
inline Setting & lookup(const std::string &path) const inline Setting & lookup(const std::string &path) const
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment