AnalysisObject_Impl::AnalysisObject_Impl(const std::string& name) : m_uuid(createUUID()), m_versionUUID(createUUID()), m_name(name), m_displayName(name), m_dirty(true) {}
AnalysisObject_Impl::AnalysisObject_Impl(const AnalysisObject_Impl &other) : m_uuid(createUUID()), m_versionUUID(createUUID()), m_name(other.name()), m_displayName(other.displayName()), m_description(other.description()), m_dirty(true) {}
OSArgument::OSArgument(const std::string& name, const OSArgumentType& type, bool required, bool modelDependent) : m_uuid(createUUID()), m_versionUUID(createUUID()), m_name(name), m_displayName(name), m_type(type), m_required(required), m_modelDependent(modelDependent), m_isRead(false) {}
UUID ComponentData_Impl::createVersionUUID() { bool ok = setString(OS_ComponentDataFields::VersionUUID,toString(createUUID())); OS_ASSERT(ok); ok = setInt(OS_ComponentDataFields::VersionTimestamp,time(nullptr)); OS_ASSERT(ok); return versionUUID(); }
/// @cond ComponentData::ComponentData(const Model& model) : ModelObject(iddObjectType(),model) { OS_ASSERT(getImpl<detail::ComponentData_Impl>()); setString(OS_ComponentDataFields::UUID,toString(createUUID())); setInt(OS_ComponentDataFields::CreationTimestamp,time(nullptr)); createVersionUUID(); }
std::string createUniqueName(const std::string& prefix) { std::stringstream ss; if (!prefix.empty()) { ss << prefix << " "; } ss << toString(createUUID()); return ss.str(); }
WindowGroup::WindowGroup(const openstudio::Vector3d& outwardNormal, const model::Space& space, const model::ConstructionBase& construction, const boost::optional<model::ShadingControl>& shadingControl) : m_outwardNormal(outwardNormal), m_space(space), m_construction(construction), m_shadingControl(shadingControl) { // start with a gross name, forward translator is in charge of nice names m_name = "WG" + toString(createUUID()); m_outwardNormal.normalize(); }
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()); }
bool FileReference::update(const openstudio::path& searchDirectory) { makePathAbsolute(searchDirectory); openstudio::path p = path(); if (openstudio::filesystem::exists(p)) { m_timestampLast = DateTime::fromEpoch(openstudio::filesystem::last_write_time_as_time_t(p)); m_checksumLast = checksum(p); m_versionUUID = createUUID(); return true; } return false; }
void ObjectRecord_Impl::onChange(bool newVersion) { if (newVersion) { m_lastUUIDLast = m_uuidLast; m_lastTimestampLast = m_timestampLast; m_uuidLast = createUUID(); m_timestampLast = DateTime::now(); } Record_Impl::onChange(newVersion); }
/* extracts and saves the AES key info from the plaintext; * parameter smpte is true for SMPTE DCP, false for Interop; * see SMPTE 430-1-2006, section 6.1.2 for the exact structure of the plaintext */ int AESKey::extractInfo( unsigned char * ps_plain_text, bool smpte ) { string s_rsa_structID( "f1dc124460169a0e85bc300642f866ab" ); /* unique Structure ID for all RSA-encrypted AES keys in a KDM */ string s_carrier; char psz_hex[3]; int i_ret, i_pos = 0; /* check for the structure ID */ while( i_pos < 16 ) { i_ret = snprintf( psz_hex, 3, "%02hhx", ps_plain_text[i_pos] ); if( i_ret != 2 ) { msg_Err( this->p_demux, "error while extracting structure ID from decrypted cipher" ); return VLC_EGENERIC; } try { s_carrier.append( psz_hex ); } catch( ... ) { msg_Err( this->p_demux, "error while handling string" ); return VLC_EGENERIC; } i_pos++; } if( s_carrier.compare( s_rsa_structID ) ) { msg_Err( this->p_demux, "incorrect RSA structure ID: KDM may be broken" ); return VLC_EGENERIC; } i_pos += 36; /* TODO thumbprint, CPL ID */ if( smpte ) /* only SMPTE DCPs have the 4-byte "KeyType" field */ i_pos += 4; /* extract the AES key UUID */ if( ( this->s_key_id = createUUID( ps_plain_text + i_pos ) ).empty() ) { msg_Err( this->p_demux, "error while extracting AES Key UUID" ); return VLC_EGENERIC; } i_pos += 16; i_pos += 50; /* TODO KeyEpoch */ /* extract the AES key */ memcpy( this->ps_key, ps_plain_text + i_pos, 16 ); return VLC_SUCCESS; }
bool FileReference::makePathRelative(const openstudio::path& basePath) { openstudio::path newPath; if (basePath.empty()) { newPath = path().filename(); } else { newPath = relativePath(path(),basePath); } if (newPath.empty()) { return false; } m_path = newPath; m_versionUUID = createUUID(); return true; }
PortListener::PortListener(KService::Ptr s, KConfig *config, KServiceRegistry *srvreg) : m_port(-1), m_serviceRegistered(false), m_socket(0), m_config(config), m_srvreg(srvreg), m_dnssdreg(0) { m_dnssdRegistered = false; m_uuid = createUUID(); loadConfig(s); if (m_valid && m_enabled) acquirePort(); }
bool FileReference::update(const openstudio::path& searchDirectory,bool lastOnly) { makePathAbsolute(searchDirectory); openstudio::path p = path(); if (boost::filesystem::exists(p)) { QFileInfo fileInfo(toQString(p)); OS_ASSERT(fileInfo.exists()); if (!lastOnly) { m_timestampCreate = toDateTime(fileInfo.created()); } m_timestampLast = toDateTime(fileInfo.lastModified()); m_checksumLast = checksum(p); m_versionUUID = createUUID(); return true; } return false; }
WorkflowRecord_Impl::WorkflowRecord_Impl(const runmanager::Workflow& workflow, ProblemRecord& problemRecord, int workflowIndex) : ObjectRecord_Impl(problemRecord.projectDatabase(), workflow.uuid(), "", "", "", createUUID()), m_problemRecordId(problemRecord.id()), m_workflowIndex(workflowIndex) { openstudio::runmanager::RunManager runManager = problemRecord.projectDatabase().runManager(); try { m_runManagerWorkflowKey = runManager.persistWorkflow(workflow); } catch (const std::exception& e) { LOG(Error,"Could not persist workflow, because '" << e.what() << "'."); } }
void MSBuildProvider::createFiltersFile(const BuildSetup &setup, const std::string &name) { // No filters => no need to create a filter file if (_filters.empty()) return; // Sort all list alphabetically _filters.sort(); _compileFiles.sort(); _includeFiles.sort(); _otherFiles.sort(); _resourceFiles.sort(); _asmFiles.sort(); const std::string filtersFile = setup.outputDir + '/' + name + getProjectExtension() + ".filters"; std::ofstream filters(filtersFile.c_str()); if (!filters) error("Could not open \"" + filtersFile + "\" for writing"); filters << "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" "<Project ToolsVersion=\"" << (_version >= 12 ? _version : 4) << ".0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n"; // Output the list of filters filters << "\t<ItemGroup>\n"; for (std::list<std::string>::iterator filter = _filters.begin(); filter != _filters.end(); ++filter) { filters << "\t\t<Filter Include=\"" << *filter << "\">\n" "\t\t\t<UniqueIdentifier>" << createUUID() << "</UniqueIdentifier>\n" "\t\t</Filter>\n"; } filters << "\t</ItemGroup>\n"; // Output files outputFilter(filters, _compileFiles, "ClCompile"); outputFilter(filters, _includeFiles, "ClInclude"); outputFilter(filters, _otherFiles, "None"); outputFilter(filters, _resourceFiles, "ResourceCompile"); outputFilter(filters, _asmFiles, "CustomBuild"); filters << "</Project>"; }
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; }
Tag::Tag(const std::string& name) : m_uuid(createUUID()), m_name(name) {}
OSArgument::OSArgument() : m_uuid(createUUID()), m_versionUUID(createUUID()) {}
void MSVCProvider::createWorkspace(const BuildSetup &setup) { UUIDMap::const_iterator svmUUID = _uuidMap.find("scummvm"); if (svmUUID == _uuidMap.end()) error("No UUID for \"scummvm\" project created"); const std::string svmProjectUUID = svmUUID->second; assert(!svmProjectUUID.empty()); std::string solutionUUID = createUUID(); std::ofstream solution((setup.outputDir + '/' + "scummvm.sln").c_str()); if (!solution) error("Could not open \"" + setup.outputDir + '/' + "scummvm.sln\" for writing"); solution << "Microsoft Visual Studio Solution File, Format Version " << _version + 1 << ".00\n"; solution << "# Visual Studio " << getVisualStudioVersion() << "\n"; solution << "Project(\"{" << solutionUUID << "}\") = \"scummvm\", \"scummvm" << getProjectExtension() << "\", \"{" << svmProjectUUID << "}\"\n"; // Project dependencies are moved to vcxproj files in Visual Studio 2010 if (_version < 10) writeReferences(solution); solution << "EndProject\n"; // Note we assume that the UUID map only includes UUIDs for enabled engines! for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) { if (i->first == "scummvm") continue; solution << "Project(\"{" << solutionUUID << "}\") = \"" << i->first << "\", \"" << i->first << getProjectExtension() << "\", \"{" << i->second << "}\"\n" << "EndProject\n"; } solution << "Global\n" "\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n" "\t\tDebug|Win32 = Debug|Win32\n" "\t\tAnalysis|Win32 = Analysis|Win32\n" "\t\tRelease|Win32 = Release|Win32\n" "\t\tDebug|x64 = Debug|x64\n" "\t\tAnalysis|x64 = Analysis|x64\n" "\t\tRelease|x64 = Release|x64\n" "\tEndGlobalSection\n" "\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n"; for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) { solution << "\t\t{" << i->second << "}.Debug|Win32.ActiveCfg = Debug|Win32\n" "\t\t{" << i->second << "}.Debug|Win32.Build.0 = Debug|Win32\n" "\t\t{" << i->second << "}.Analysis|Win32.ActiveCfg = Analysis|Win32\n" "\t\t{" << i->second << "}.Analysis|Win32.Build.0 = Analysis|Win32\n" "\t\t{" << i->second << "}.Release|Win32.ActiveCfg = Release|Win32\n" "\t\t{" << i->second << "}.Release|Win32.Build.0 = Release|Win32\n" "\t\t{" << i->second << "}.Debug|x64.ActiveCfg = Debug|x64\n" "\t\t{" << i->second << "}.Debug|x64.Build.0 = Debug|x64\n" "\t\t{" << i->second << "}.Analysis|x64.ActiveCfg = Analysis|x64\n" "\t\t{" << i->second << "}.Analysis|x64.Build.0 = Analysis|x64\n" "\t\t{" << i->second << "}.Release|x64.ActiveCfg = Release|x64\n" "\t\t{" << i->second << "}.Release|x64.Build.0 = Release|x64\n"; } solution << "\tEndGlobalSection\n" "\tGlobalSection(SolutionProperties) = preSolution\n" "\t\tHideSolutionNode = FALSE\n" "\tEndGlobalSection\n" "EndGlobal\n"; }
RulesetObject_Impl::RulesetObject_Impl() : m_uuid(createUUID()), m_versionUUID(createUUID()) {}
RulesetObject_Impl::RulesetObject_Impl(const RulesetObject_Impl& other) : m_uuid(createUUID()), m_versionUUID(createUUID()) {}
void FileReference::setName(const std::string& newName) { m_name = newName; m_versionUUID = createUUID(); }
void AnalysisObject_Impl::onChange(ChangeType changeType) { m_versionUUID = createUUID(); m_dirty = true; emit changed(changeType); }
void FileReference::setDescription(const std::string& newDescription) { m_description = newDescription; m_versionUUID = createUUID(); }
void OSArgument::onChange() { m_versionUUID = createUUID(); }
void FileReference::setPath(const openstudio::path& newPath) { if (newPath != m_path) { m_path = newPath; m_versionUUID = createUUID(); } }
FileReference FileReference::clone() const { FileReference result(*this); result.m_uuid = createUUID(); result.m_versionUUID = createUUID(); return result; }
Tag Tag::clone() const { Tag result(*this); result.m_uuid = createUUID(); return result; }
void FileReference::setDisplayName(const std::string& newDisplayName) { m_displayName = newDisplayName; m_versionUUID = createUUID(); }