Beispiel #1
0
/**
 * @sa Map_Write
 */
bool MapResource_saveFile (const MapFormat& format, scene::Node& root, GraphTraversalFunc traverse,
                           const std::string& filename)
{
    TextFileOutputStream file(filename);
    if (!file.failed()) {
        ScopeDisableScreenUpdates disableScreenUpdates(os::getFilenameFromPath(filename), _("Saving Map"));
        format.writeGraph(root, traverse, file);
        return true;
    }

    globalErrorStream() << "ERROR: open file for writing failed: " << filename << "\n";
    return false;
}
Beispiel #2
0
bool MapResource_saveFile(const MapFormat& format, scene::Node& root, GraphTraversalFunc traverse, const char* filename)
{
  //ASSERT_MESSAGE(path_is_absolute(filename), "MapResource_saveFile: path is not absolute: " << makeQuoted(filename));
  globalOutputStream() << "Open file " << filename << " for write...";
  TextFileOutputStream file(filename);
  if(!file.failed())
  {
    globalOutputStream() << "success\n";
    ScopeDisableScreenUpdates disableScreenUpdates(path_get_filename_start(filename), "Saving Map");
    format.writeGraph(root, traverse, file);
    return true;
  }

  globalErrorStream() << "failure\n";
  return false;
}