mirror of
https://github.com/znc/znc.git
synced 2026-08-07 01:13:25 +02:00
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:
+4
-1
@@ -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 )
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user