Пример #1
0
 void ProjectDatabaseRecord_Impl::updatePathData(const openstudio::path& originalBase,
                                                 const openstudio::path& newBase)
 {
   // don't use arguments -- go to the source
   ProjectDatabase database = projectDatabase();
   setName(toString(database.path()));
   setRunManagerDBPath(completeAndNormalize(database.runManager().dbPath()));
 }
Пример #2
0
 ProjectDatabaseRecord_Impl::ProjectDatabaseRecord_Impl(const std::string& version,
                                                        const openstudio::path& runManagerDBPath,
                                                        const ProjectDatabase& projectDatabase)
   : ObjectRecord_Impl(projectDatabase,
                       toString(projectDatabase.path()),
                       toString(projectDatabase.path().filename()),
                       ""),
   m_version(version),
   m_runManagerDBPath(completeAndNormalize(runManagerDBPath))
 {
 }
Пример #3
0
FileReference::FileReference(const openstudio::path& p)
  : m_uuid(createUUID()),
    m_versionUUID(createUUID()),
    m_name(toString(p)),
    m_displayName(toString(p.filename())),
    m_path(completeAndNormalize(p)),
    m_timestampLast(),
    m_checksumCreate(checksum(m_path)),
    m_checksumLast(m_checksumCreate)
{
  try {
    m_fileType = FileReferenceType(getFileExtension(p));
  }
  catch (...) {
    m_fileType = FileReferenceType::Unknown;
  }
  update(openstudio::path());
}
Пример #4
0
bool FileReference::makePathAbsolute(const openstudio::path& searchDirectory) {
  // trivial completion
  openstudio::path currentPath = path();
  if (currentPath.is_complete() && openstudio::filesystem::exists(currentPath)) {
    return true;
  }
  openstudio::path workingPath(currentPath);
  // if currentPath is complete but does not exist, go to extreme measures
  if (currentPath.is_complete()) {
    workingPath = currentPath.filename();
  }
  if (searchDirectory.empty()) {
    return false;
  }
  openstudio::path newPath = openstudio::filesystem::complete(workingPath,searchDirectory);
  if (newPath.empty() || !openstudio::filesystem::exists(newPath)) {
    return false;
  }
  m_path = completeAndNormalize(newPath);
  m_versionUUID = createUUID();
  return true;
}
Пример #5
0
 void OSArgumentRecord_Impl::setDefaultValue(const openstudio::path& defaultValue) {
   if (type() == ruleset::OSArgumentType::Path) {
     m_defaultArgumentValue = toString(completeAndNormalize(defaultValue));
     onChange();
   }
 }
Пример #6
0
 void ProjectDatabaseRecord_Impl::setRunManagerDBPath(const openstudio::path& newPath) {
   m_runManagerDBPath = completeAndNormalize(newPath);
   this->onChange();
 }