Skip to content

Commit

Permalink
Merge pull request #246 from StormBytePP/master
Browse files Browse the repository at this point in the history
Make WriteFile const so constant objects can write their contents
  • Loading branch information
hyperrealm authored Oct 31, 2024
2 parents 6234e8e + 50b4470 commit e4c5d2c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/libconfig.h++
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,8 @@ class LIBCONFIGXX_API Config
inline void readFile(const std::string &filename)
{ readFile(filename.c_str()); }

void writeFile(const char *filename);
inline void writeFile(const std::string &filename)
void writeFile(const char *filename) const;
inline void writeFile(const std::string &filename) const
{ writeFile(filename.c_str()); }

Setting & lookup(const char *path) const;
Expand Down
2 changes: 1 addition & 1 deletion lib/libconfigcpp.c++
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ void Config::readFile(const char *filename)

// ---------------------------------------------------------------------------

void Config::writeFile(const char *filename)
void Config::writeFile(const char *filename) const
{
if(! config_write_file(_config, filename))
handleError();
Expand Down

0 comments on commit e4c5d2c

Please sign in to comment.