Exemple #1
0
TextWriter *
CreateDataTextFile(const TCHAR *name, bool append)
{
  assert(name != nullptr);
  assert(!StringIsEmpty(name));

  const auto path = LocalPath(name);

  TextWriter *writer = new TextWriter(path, append);
  if (writer == nullptr)
    return nullptr;

  if (!writer->IsOpen()) {
    delete writer;
    return nullptr;
  }

  return writer;
}
Exemple #2
0
 bool IsOpen() const {
   return file.IsOpen();
 }