Browse Source

Making use of new print and println functions.

release/0.19
JustinAJ 11 years ago
parent
commit
053a491817
  1. 3
      Jupiter/File.cpp
  2. 12
      Jupiter/INIFile.cpp

3
Jupiter/File.cpp

@ -199,8 +199,7 @@ bool Jupiter::File::sync(FILE *file)
{
for (unsigned int i = 0; i < Jupiter::File::data_->lineCount; i++)
{
fputs(Jupiter::File::data_->lines[i].c_str(), file);
fputs(ENDL, file);
Jupiter::File::data_->lines[i].println(file);
}
return true;
}

12
Jupiter/INIFile.cpp

@ -328,11 +328,7 @@ void Jupiter::INIFile::flushData()
// TODO: Rewrite this.
unsigned int Jupiter::INIFile::readFile(const char *fileName)
{
int count = 0;
if (Jupiter::INIFile::data_->fName.size() != 0)
{
Jupiter::INIFile::data_->fName = "";
}
unsigned int count = 0;
Jupiter::INIFile::data_->fName = fileName;
FILE *file = fopen(Jupiter::INIFile::data_->fName.c_str(), "rb");
if (file == nullptr) return Jupiter::ERROR_INDICATOR;
@ -394,16 +390,16 @@ bool Jupiter::INIFile::sync(const char *fileName)
{
section = Jupiter::INIFile::data_->data.get(a);
fputc('[', file);
fputs(section->getName().c_str(), file);
section->getName().print(file);
fputs("]" ENDL, file);
sectionSize = section->size();
for (unsigned int b = 0; b < sectionSize; b++)
{
pair = section->getPair(b);
fputs(pair->getKey().c_str(), file);
pair->getKey().print(file);
fputc('=', file);
fputs(pair->getValue().c_str(), file);
pair->getValue().print(file);
fputs(ENDL, file);
}
fputs(ENDL, file);

Loading…
Cancel
Save