diff --git a/GdbObj.cpp b/GdbObj.cpp index 206c2a2..69c8409 100644 --- a/GdbObj.cpp +++ b/GdbObj.cpp @@ -23,6 +23,7 @@ #include "/EgtDev/Include/EGkGdbFunct.h" #include "/EgtDev/Include/EGkStringUtils3d.h" #include "/EgtDev/Include/EGkObjUserFactory.h" +#include "/EgtDev/Include/EGnStringKeyVal.h" #include using namespace std ; @@ -1004,6 +1005,9 @@ GdbObj::SaveObjUser( NgeWriter& ngeOut) const STRVECTOR vString ; if ( ! m_pObjUser->Save( vString)) return false ; + // eseguo validazione di queste stringhe + for ( auto iIter = vString.begin() ; iIter != vString.end() ; ++ iIter) + ValidateKeyVal( *iIter) ; // scrivo i dati : // flag presenza ObjUser if ( ! ngeOut.WriteKey( NGE_U)) diff --git a/ObjUserFactory.cpp b/ObjUserFactory.cpp index 51a798e..926b57d 100644 --- a/ObjUserFactory.cpp +++ b/ObjUserFactory.cpp @@ -15,18 +15,20 @@ #include "stdafx.h" #include "/EgtDev/Include/EGkObjUserFactory.h" +using namespace std ; + //---------------------------------------------------------------------------- bool -ObjUserFactory::Register( const std::string& sName, ObjUserCreator Creator) +ObjUserFactory::Register( const string& sName, ObjUserCreator Creator) { return GetCreatorMap().emplace( sName, Creator).second ; } //---------------------------------------------------------------------------- IObjUser* -ObjUserFactory::Create( const std::string& sName) +ObjUserFactory::Create( const string& sName) { - CreatorMap::iterator Iter = GetCreatorMap().find( sName) ; + auto Iter = GetCreatorMap().find( sName) ; if ( Iter != GetCreatorMap().end()) { if ( Iter->second != nullptr) return Iter->second() ; @@ -34,6 +36,19 @@ ObjUserFactory::Create( const std::string& sName) return nullptr ; } +//---------------------------------------------------------------------------- +bool +ObjUserFactory::GetList( STRVECTOR& vsList) +{ + // verifico parametro di ritorno + if ( &vsList == nullptr) + return false ; + // ciclo sugli oggetti registrati + for ( auto Iter = GetCreatorMap().cbegin() ; Iter != GetCreatorMap().cend() ; ++ Iter) + vsList.emplace_back( Iter->first) ; + return true ; +} + //---------------------------------------------------------------------------- ObjUserFactory::CreatorMap& ObjUserFactory::GetCreatorMap( void)