void ControllerElement::ReadAttributes(const DOMNode* node) { _ASSERTE(node != NULL); DOMNamedNodeMap* attr = node->getAttributes(); if( attr == NULL ) { return ; } SetStringValue( attrId, Get_id_Attribute( attr ) ); SetStringValue( attrName, Get_name_Attribute( attr ) ); }
void JointsElement::ReadAttributes(const DOMNode* node) { _ASSERTE(node != NULL); DOMNamedNodeMap* attr = node->getAttributes(); if( attr == NULL ) { return; } SetStringValue( attrId, Get_id_Attribute( attr ) ); SetStringValue( attrName, Get_name_Attribute( attr ) ); SetUIntValue( attrCount, Get_count_Attribute( attr ) ); }
void CodeElement::ReadAttributes(const DOMNode* node) { _ASSERTE(node != NULL); DOMNamedNodeMap* attr = node->getAttributes(); if( attr == NULL ) { return ; } SetStringValue( attrId, Get_id_Attribute( attr ) ); SetStringValue( attrLang, Get_lang_Attribute( attr ) ); SetStringValue( attrProfile, Get_profile_Attribute( attr ) ); SetStringValue( attrSemantic, Get_semantic_Attribute( attr ) ); SetStringValue( attrUrl, Get_url_Attribute( attr ) ); }
bool OfflineDataStore::AddW3FileToDocId(const CStdString& sDocID, const CStdString &sW3File, const CStdString& sDocDescription) { AddDocIdKey(sDocID); CRegKey rk = GetRKeyForDocID(sDocID, KEY_WRITE); if (rk.m_hKey == NULL) return false; if( SetStringValue( rk, _T("W3File"), sW3File ) ) return SetStringValue( rk, _T("Description"), sDocDescription ); return false; }
void ParamElement::ReadAttributes(const DOMNode* node) { _ASSERTE(node != NULL); DOMNamedNodeMap* attr = node->getAttributes(); if( attr == NULL ) { return; } SetStringValue( attrId, Get_id_Attribute( attr ) ); SetStringValue( attrName, Get_name_Attribute( attr ) ); SetFlow( Get_flow_Attribute( attr ) ); SetStringValue( attrSemantic, Get_semantic_Attribute( attr ) ); SetType( Get_type_Attribute( attr ) ); SetStringValue( attrSubId, Get_sid_Attribute( attr ) ); }
NS_IMETHODIMP nsAbLDAPDirectory::SetProtocolVersion(PRUint32 aProtocolVersion) { // XXX We should cancel any existing LDAP connections here and // be ready to re-initialise them with the new auth details. return SetStringValue("protocolVersion", aProtocolVersion == nsILDAPConnection::VERSION3 ? NS_LITERAL_CSTRING("3") : NS_LITERAL_CSTRING("2")); }
bool ConfigFile::SetFloatValue( std::string Key, int ArrayIndex, float Value ) { char val[200]; sprintf( (char*)&val, "%f", Value ); std::string* s = new std::string( val ); bool r = SetStringValue( Key, ArrayIndex, s ); return r; }
bool ConfigFile::SetInteger64Value( std::string Key, int64_t Value ) { char val[200]; sprintf( (char*)&val, "%d", Value ); std::string* s = new std::string( val ); bool r = SetStringValue( Key, s ); return r; }
LONG ServiceRegistry::SetStringValue(String hKey, String ValueName, String data) { HKEY key; LONG l = GetKey(hKey, key); if (l == ERROR_SUCCESS) return SetStringValue(key, ValueName, data); return l; }
void BaseValue::ReadAttributes(const DOMNode* node) { _ASSERTE(node != NULL); DOMNamedNodeMap* attr = node->getAttributes(); if( attr == NULL ) { return; } SetStringValue( attrSubId, Get_sid_Attribute( attr ) ); }
bool OfflineDataStore::SetW3FilePath(const CStdString& sDocID, const CStdString& sW3FileLocation) { AddDocIdKey(sDocID); CRegKey rk = GetRKeyForDocID(sDocID, KEY_WRITE); if (rk.m_hKey == NULL) return false; return SetStringValue( rk, _T("W3File"), sW3FileLocation ); }
bool OptionsList::SetStringValueIfUnset(const std::string& tag, const std::string& value, bool allow_clobber, /* = true */ bool dont_print /* = false */) { std::string val; bool found = GetStringValue(tag, val, ""); if (!found) { return SetStringValue(tag, value, allow_clobber, dont_print); } return true; }
BOOL CRegistry::SetValue(LPCTSTR name_of_value, const CString& string_to_write) { ASSERT(name_of_value != NULL); if (name_of_value == NULL) { m_ErrorCode = ERROR_INVALID_PARAMETER; return(FALSE); } return(SetStringValue(name_of_value, string_to_write)); }
SVGCircleElement::SVGCircleElement(NamedNodeMap* attributes) : SVGEllipticalShapeElement(new PSVGCircleElement(this), attributes), AnimatedAttributeAffectsBoundsT<SVGAnimatedLength, 2>(this, NULL, WSTR("r")) { #if 0 m_rAttr->m_callbacks = &s_rCallbacks; m_r = new SVGAnimatedLength; m_r->m_baseValChanged = rBaseValChanged; m_r->m_arg0 = this; SetStringValue(m_r->m_baseVal, m_rAttr->get_value()); #endif }
NS_IMETHODIMP nsAbLDAPDirectory::SetLDAPURL(nsILDAPURL *aUrl) { NS_ENSURE_ARG_POINTER(aUrl); nsCAutoString oldUrl; // Note, it doesn't matter if GetStringValue fails - we'll just send an // update if its blank (i.e. old value not set). GetStringValue("uri", EmptyCString(), oldUrl); // Actually set the new value. nsCString tempLDAPURL; nsresult rv = aUrl->GetSpec(tempLDAPURL); NS_ENSURE_SUCCESS(rv, rv); rv = SetStringValue("uri", tempLDAPURL); NS_ENSURE_SUCCESS(rv, rv); // Now we need to send an update which will ensure our indicators and // listeners get updated correctly. // See if they both start with ldaps: or ldap: PRBool newIsNotSecure = StringHead(tempLDAPURL, 5).Equals("ldap:"); if (oldUrl.IsEmpty() || StringHead(oldUrl, 5).Equals("ldap:") != newIsNotSecure) { // They don't so its time to send round an update. nsCOMPtr<nsIAbManager> abManager = do_GetService(NS_ABMANAGER_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); // We inherit from nsAbDirProperty, so this static cast should be safe. abManager->NotifyItemPropertyChanged(static_cast<nsAbDirProperty*>(this), "IsSecure", (newIsNotSecure ? NS_LITERAL_STRING("true") : NS_LITERAL_STRING("false")).get(), (newIsNotSecure ? NS_LITERAL_STRING("false") : NS_LITERAL_STRING("true")).get()); } return NS_OK; }
bool BayesianClassifier::Save(xmlNodePtr classifierNode) { int i; bool retCode = true; xmlNodePtr modelNode; SetIntValue(classifierNode, DIMENSION_STR, mNumDimensions); SetIntValue(classifierNode, CLASSES_STR, mNumClasses); SetStringValue(classifierNode, FEATURE_STR, mFeatureString); for (i = 0; (i < mNumClasses) && retCode; i++) { modelNode = xmlNewNode(NULL, (const xmlChar*)GMM_STR); xmlAddChild(classifierNode, modelNode); SetDoubleValue(modelNode, WEIGHT_STR, mClassWeights[i]); retCode = mModels[i].Save(modelNode); if ( !retCode ) fprintf(stderr, "BayesianClassifier::Save - Failed saviing GMM %d\n", i); } return retCode; }
BOOL COptionsMisc::Save() { SetBoolValue("ParentFolder", m_bParentFolder ? TRUE : FALSE); // Save Thumbnails Info SetBoolValue("ShowIcons", m_bShowIcons ? TRUE : FALSE); // Save Thumbnails Info SetBoolValue("ShowThumbnails", m_bShowThumbnails ? TRUE : FALSE); SetBoolValue("AutoExtractIcons", IsAutoExtractIcons() ? TRUE : FALSE); SetBoolValue("AutoExtractClassHelp", IsAutoExtractClassHelp() ? TRUE : FALSE); SetBoolValue("ShowUndoWarnings", GetShowUndoWarnings() ? TRUE : FALSE); SetBoolValue("ShowFullPathInTitle", IsShowFullPathTitle() ? TRUE : FALSE); SetBoolValue("AutoLoadProj", IsAutoLoadProj() ? TRUE : FALSE); SetBoolValue("DefaultCompressed", IsDefaultCompressed() ? TRUE : FALSE); SetBoolValue("LoadLYTFile", IsLoadLYTFile() ? TRUE : FALSE); SetBoolValue("UndoFreezeHide", IsUndoFreezeHide() ? TRUE : FALSE); //for formatting the floats CString sVal; sVal.Format("%f", GetVectorEditIncrement()); SetStringValue("VectorEditIncrement", sVal); SetBoolValue("VectorEditAutoApply", IsVectorEditAutoApply() ? TRUE : FALSE); SetBoolValue("RotationEditAutoApply", IsRotationEditAutoApply() ? TRUE : FALSE); // Save undo data SetDWordValue("NumUndos", m_dwUndos); return TRUE; }
NS_IMETHODIMP nsAbLDAPDirectory::SetDataVersion(const nsACString &aDataVersion) { return SetStringValue("dataVersion", aDataVersion); }
/// Sets the content or an attribute of a node just below root level to be "Yes" or "No". /// @param nodeName The node name. Will be created if it doesn't already exist. /// @param value The value to set (true becomes "Yes"). /// @param attrName The optional attribute name to use, instead of using the node content. void SavedState::SetBoolValue(const wxString & nodeName, const bool value, const wxString & attrName) { SetStringValue(nodeName, value ? wxT("Yes") : wxT("No"), attrName); }
/// Sets the content or an attribute of a node just below root level to be "Yes" or "No". /// @param nodeName The node name. Will be created if it doesn't already exist. /// @param value The value to set. /// @param attrName The optional attribute name to use, instead of using the node content. void SavedState::SetUnsignedLongValue(const wxString & nodeName, const unsigned long value, const wxString & attrName) { SetStringValue(nodeName, wxString::Format(wxT("%lu"), value), attrName); }
void CMediaStream::Initialize (bool check_config_name) { // reads the configuration file CConfigEntry::Initialize(check_config_name); if (m_valid == false) { return; } // set variables based on information we read if (GetBoolValue(STREAM_VIDEO_ENABLED)) { if (m_video_profile_list == NULL) { error_message("No video profiles to read"); m_valid = false; return; } SetVideoProfile(GetStringValue(STREAM_VIDEO_PROFILE)); if (m_pVideoProfile == NULL) { SetVideoProfile("default"); if (m_pVideoProfile == NULL) { error_message("Video profile \"%s\" could not be found in stream %s", GetStringValue(STREAM_VIDEO_PROFILE), GetStringValue(STREAM_NAME)); m_valid = false; return; } SetStringValue(STREAM_VIDEO_PROFILE, "default"); } } if (GetBoolValue(STREAM_AUDIO_ENABLED)) { if (m_audio_profile_list == NULL) { error_message("No audio profiles to read"); m_valid = false; return; } SetAudioProfile(GetStringValue(STREAM_AUDIO_PROFILE)); if (m_pAudioProfile == NULL) { SetAudioProfile("default"); if (m_pAudioProfile == NULL) { error_message("Audio profile \"%s\" could not be found in stream %s", GetStringValue(STREAM_AUDIO_PROFILE), GetStringValue(STREAM_NAME)); m_valid = false; return; } SetStringValue(STREAM_AUDIO_PROFILE, "default"); } } if (GetBoolValue(STREAM_TEXT_ENABLED)) { if (m_text_profile_list == NULL) { error_message("No text profiles to read"); m_valid = false; return; } SetTextProfile(GetStringValue(STREAM_TEXT_PROFILE)); if (m_pTextProfile == NULL) { SetTextProfile("default"); if (m_pTextProfile == NULL) { error_message("Text profile \"%s\" could not be found in stream %s", GetStringValue(STREAM_TEXT_PROFILE), GetStringValue(STREAM_NAME)); m_valid = false; return; } SetStringValue(STREAM_TEXT_PROFILE, "default"); } } // same profile for text here... char buffer[PATH_MAX]; // Set up the file names, if they do not already exist const char *last_sep = strrchr(m_filename, '/'); if (last_sep == NULL) last_sep = m_filename; else last_sep++; if (GetStringValue(STREAM_SDP_FILE_NAME) == NULL) { snprintf(buffer, PATH_MAX, "%s.sdp", last_sep); SetStringValue(STREAM_SDP_FILE_NAME, buffer); debug_message("Setting stream %s sdp file to \"%s\"", GetName(), buffer); } if (GetStringValue(STREAM_RECORD_MP4_FILE_NAME) == NULL) { // set file name snprintf(buffer, PATH_MAX, "%s.mp4", last_sep); SetStringValue(STREAM_RECORD_MP4_FILE_NAME, buffer); debug_message("Setting stream %s file to \"%s\"", GetName(), buffer); } if (GetStringValue(STREAM_CAPTION) == NULL) { if (GetStringValue(STREAM_NAME) == NULL) SetStringValue(STREAM_CAPTION, "default"); else SetStringValue(STREAM_CAPTION, GetStringValue(STREAM_NAME)); debug_message("Setting stream %s caption to \"%s\"", GetName(), GetStringValue(STREAM_NAME)); } }
void CMediaStream::SetAudioProfile (const char *name) { SetStringValue(STREAM_AUDIO_PROFILE, name); m_pAudioProfile = m_audio_profile_list->FindProfile(name); }
void CMediaStream::SetTextProfile (const char *name) { SetStringValue(STREAM_TEXT_PROFILE, name); m_pTextProfile = m_text_profile_list->FindProfile(name); }
void CMediaStream::SetVideoProfile (const char *name) { SetStringValue(STREAM_VIDEO_PROFILE, name); m_pVideoProfile = m_video_profile_list->FindProfile(name); }
NS_IMETHODIMP nsAbLDAPDirectory::SetObjectClasses(const nsACString &aObjectClasses) { return SetStringValue("objectClasses", aObjectClasses); }
NS_IMETHODIMP nsAbLDAPDirectory::SetReplicationFileName(const nsACString &aReplicationFileName) { return SetStringValue("filename", aReplicationFileName); }
NS_IMETHODIMP nsAbLDAPDirectory::SetAuthDn(const nsACString &aAuthDn) { // XXX We should cancel any existing LDAP connections here and // be ready to re-initialise them with the new auth details. return SetStringValue("auth.dn", aAuthDn); }
NS_IMETHODIMP nsAbLDAPDirectory::SetSaslMechanism(const nsACString &aSaslMechanism) { return SetStringValue("auth.saslmech", aSaslMechanism); }
void wxTextWidgetImpl::Clear() { SetStringValue( wxEmptyString ) ; }
NS_IMETHODIMP nsAbLDAPDirectory::SetRdnAttributes(const nsACString &aRdnAttributes) { return SetStringValue("rdnAttributes", aRdnAttributes); }