Skip to content

Commit

Permalink
Make WriteFile const so constant objects can write their contents
Browse files Browse the repository at this point in the history
  • Loading branch information
StormBytePP committed Oct 30, 2024
1 parent 6234e8e commit 50b4470
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 50b4470

Please sign in to comment.