Browse Source

Minor changes and cleanup

release/0.19
Jessica James 8 years ago
parent
commit
3665c71369
  1. 9
      Jupiter/Config.cpp
  2. 3
      Jupiter/Config.h
  3. 2
      Jupiter/INIConfig.cpp
  4. 13
      Jupiter/INIConfig.h
  5. 2
      Jupiter/Plugin.cpp
  6. 2
      Jupiter/Plugin.h

9
Jupiter/Config.cpp

@ -93,9 +93,9 @@ bool Jupiter::Config::write()
return this->write(m_name.c_str());
}
bool Jupiter::Config::write(const char *)
bool Jupiter::Config::write(const char *in_filename)
{
return false;
return this->write_internal(in_filename);
}
bool Jupiter::Config::write(const Jupiter::ReadableString &in_filename)
@ -134,6 +134,11 @@ bool Jupiter::Config::read_internal(const char *)
return false;
}
bool Jupiter::Config::write_internal(const char *)
{
return false;
}
void Jupiter::Config::Buffer::set_length(size_t in_length)
{
this->length = in_length;

3
Jupiter/Config.h

@ -150,7 +150,7 @@ namespace Jupiter
* @param in_filename Name of the file to write to
* @return True on success, false otherwise
*/
virtual bool write(const char *in_filename);
bool write(const char *in_filename);
/**
* @brief Writes config data to a file
@ -221,6 +221,7 @@ namespace Jupiter
protected:
virtual bool read_internal(const char *in_filename);
virtual bool write_internal(const char *in_filename);
/** Name of this Config section. This is empty or the filename at the root level. */
Jupiter::CStringS m_name;

2
Jupiter/INIConfig.cpp

@ -85,7 +85,7 @@ void Jupiter::INIConfig::write_helper(FILE *in_file, const Jupiter::Config *in_s
}
}
bool Jupiter::INIConfig::write(const char *in_filename)
bool Jupiter::INIConfig::write_internal(const char *in_filename)
{
// Open file
FILE *file = fopen(in_filename, "wb");

13
Jupiter/INIConfig.h

@ -36,20 +36,13 @@ namespace Jupiter
{
/**
* @brief INI-based Config class
* @see Jupiter::Config
*/
class JUPITER_API INIConfig : public Jupiter::Config
{
public:
/**
* @brief Writes config data to a file
*
* @param in_filename Name of the file to write to
* @return True on success, false otherwise
*/
bool write(const char *in_filename);
private:
bool read_internal(const char *in_filename);
bool read_internal(const char *in_filename) override;
bool write_internal(const char *in_filename) override;
void write_helper(FILE *in_file, const Jupiter::Config *in_section, size_t in_depth);
};
}

2
Jupiter/Plugin.cpp

@ -107,7 +107,7 @@ const Jupiter::ReadableString &Jupiter::Plugin::getName() const
return Jupiter::Plugin::name;
}
const Jupiter::Config &Jupiter::Plugin::getConfig() const
Jupiter::Config &Jupiter::Plugin::getConfig()
{
return Jupiter::Plugin::config;
}

2
Jupiter/Plugin.h

@ -96,7 +96,7 @@ namespace Jupiter
*
* @return Plugin's configuration file.
*/
Jupiter::Config &getConfig() const;
Jupiter::Config &getConfig();
/**
* @brief Initializes the plugin.

Loading…
Cancel
Save