don't unwittingly insert the value if its not there

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@300 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
imaginos
2005-05-15 04:03:04 +00:00
parent 1f4f4aab64
commit ad9912f569
2 changed files with 9 additions and 1 deletions
+4 -1
View File
@@ -73,7 +73,10 @@ bool CModule::SetNV( const CString & sName, const CString & sValue, bool bWriteT
CString CModule::GetNV( const CString & sName )
{
return( m_mssRegistry[sName] );
MCString::iterator it = m_mssRegistry.find( sName );
if ( it != m_mssRegistry.end() )
return( it->second );
return( "" );
}
bool CModule::DelNV( const CString & sName, bool bWriteToDisk )
+5
View File
@@ -166,6 +166,10 @@ public:
bool SetNV( const CString & sName, const CString & sValue, bool bWriteToDisk = true );
CString GetNV( const CString & sName );
bool DelNV( const CString & sName, bool bWriteToDisk = true );
MCString::iterator FindNV( const CString & sName ) { return( m_mssRegistry.find( sName ) ); }
MCString::iterator EndNV() { return( m_mssRegistry.end() ); }
MCString::iterator BeginNV() { return( m_mssRegistry.begin() ); }
void DelNV( MCString::iterator it ) { m_mssRegistry.erase( it ); }
protected:
vector<CTimer*> m_vTimers;
@@ -173,6 +177,7 @@ protected:
TSocketManager<Csock>* m_pManager;
CUser* m_pUser;
CString m_sModName;
private:
MCString m_mssRegistry; //!< way to save name/value pairs. Note there is no encryption involved in this
};