FS: Removed unused ::write and ::append methods

This commit is contained in:
Paul Beckingham 2015-10-28 20:38:41 -04:00
parent c64c6ee870
commit af49564194
2 changed files with 0 additions and 70 deletions

View file

@ -481,31 +481,6 @@ void File::read (std::vector <std::string>& contents)
}
}
////////////////////////////////////////////////////////////////////////////////
// Opens if necessary.
void File::write (const std::string& line)
{
if (!_fh)
open ();
if (_fh)
fputs (line.c_str (), _fh);
}
////////////////////////////////////////////////////////////////////////////////
// Opens if necessary.
void File::write (const std::vector <std::string>& lines)
{
if (!_fh)
open ();
if (_fh)
{
for (auto& line : lines)
fputs (line.c_str (), _fh);
}
}
////////////////////////////////////////////////////////////////////////////////
// Opens if necessary.
void File::append (const std::string& line)
@ -709,46 +684,6 @@ bool File::write (
return false;
}
////////////////////////////////////////////////////////////////////////////////
bool File::append (const std::string& name, const std::string& contents)
{
std::ofstream out (expand (name).c_str (),
std::ios_base::out | std::ios_base::app);
if (out.good ())
{
out << contents;
out.close ();
return true;
}
return false;
}
////////////////////////////////////////////////////////////////////////////////
bool File::append (
const std::string& name,
const std::vector <std::string>& lines,
bool addNewlines /* = true */)
{
std::ofstream out (expand (name).c_str (),
std::ios_base::out | std::ios_base::app);
if (out.good ())
{
for (auto& line : lines)
{
out << line;
if (addNewlines)
out << "\n";
}
out.close ();
return true;
}
return false;
}
////////////////////////////////////////////////////////////////////////////////
bool File::remove (const std::string& name)
{

View file

@ -89,9 +89,6 @@ public:
void read (std::string&);
void read (std::vector <std::string>&);
void write (const std::string&);
void write (const std::vector <std::string>&);
void append (const std::string&);
void append (const std::vector <std::string>&);
@ -108,8 +105,6 @@ public:
static bool read (const std::string&, std::vector <std::string>&);
static bool write (const std::string&, const std::string&);
static bool write (const std::string&, const std::vector <std::string>&, bool addNewlines = true);
static bool append (const std::string&, const std::string&);
static bool append (const std::string&, const std::vector <std::string>&, bool addNewlines = true);
static bool remove (const std::string&);
private: