46 : m_WritableSite(ePriority_Local)
72 it->second->ToConfigFile(ostr);
93 catch (std::exception& e) {
95 "the settings will be ignored " << e.
what());
348 list< CConstRef<CUser_field> > fields;
354 fields.push_back(field);
368 if (iter->second->HasField(
key)) {
414 new_reg_file->
SetRegistry(sitereg.second->GetRegistry());
415 new_reg->
m_Registries.emplace(sitereg.first, new_reg_file);
421 const string& section)
const
438 const vector<string>& subsections)
const
445 if ( !section.empty() ) {
449 vector<string>::const_reverse_iterator riter(subsections.end());
450 vector<string>::const_reverse_iterator rend (subsections.begin());
451 for ( ; riter != rend; ++riter) {
479 const vector<string>& subsections)
487 if ( !section.empty() ) {
491 if ( ! subsections.empty()) {
492 str += subsections.back();
507 return section + delim +
key;
static string MakeKey(const string §ion, const string &key, const string &delim=CGuiRegistry::kDecimalDot)
create a key from a section and a subkey
CRef< CRegistryFile > x_GetRegistryRef(int) const
return the registry at a particular priority.
void ToConfigFile(CNcbiOstream &ostr) const
Write the local policy to a specified stream, in INI format.
CRef< objects::CUser_field > SetFieldToValue(const string &key)
same as SetField, but complain loudly if the field has subfields in it already.
CRegistryWriteView GetWriteView(const string §ion)
get a read-write view at a particular level.
bool HasField(const string &key) const
Does a field with this section and key exist in this view?
int GetWritableSite()
Get the priority of the site that Set methods modify.
void Write(CNcbiOstream &ostr, int priority=ePriority_Local) const
Write the local policy to a specified stream.
void SetWritableSite(int priority=ePriority_Local)
Set which site Set methods modify.
CRef< CGuiRegistry > Clone()
void GetIntVec(const string &key, vector< int > &val) const
void SetGlobal(CNcbiIstream &istr)
Set the "global" repository.
static const string kDecimalDot
void GetRealVec(const string &key, vector< double > &val) const
void GetStringVec(const string &key, vector< string > &val) const
void FromConfigFile(CNcbiIstream &istr)
Initialize the local repository from an ini-format config file.
CRegistryFile & x_SetRegistry(int)
return a registry at a particular priority, creating it if need be.
double GetReal(const string &key, double default_val=0) const
void GetStringList(const string &key, list< string > &val) const
static CGuiRegistry & GetInstance()
access the application-wide singleton
int m_WritableSite
The priority of the site that writes go to.
void SetLocal(CNcbiIstream &istr)
establish our "local" repository.
CConstRef< objects::CUser_field > GetField(const string &key) const
retrieve the best user field object for our key, taking into account our multiple stores.
void Set(const string &key, int val)
set specific values
CRegistryReadView GetReadView(const string §ion) const
get a read-only view at a particular level.
string GetString(const string &key, const string &default_val=kEmptyStr) const
bool DeleteField(const string &key)
delete the specified field (and any of its subfields).
CRef< CRegistryFile > AddSite(CNcbiIstream &istr, int priority)
Add a site-specific repository.
CRef< objects::CUser_field > SetField(const string &key)
retrieve the best user field object for our key, taking into account our multiple stores
void x_AppendToView(CRegistryReadView &view, const string §ion) const
Add a section to an existing view at a lower priority than any previously existing sections in that v...
int GetInt(const string &key, int default_val=0) const
retrieve values by section and key.
bool GetBool(const string &key, bool default_val=false) const
CRef< objects::CUser_field > SetFieldToValue(const string &key)
objects::CUser_object & SetRegistry()
CRef< objects::CUser_field > SetField(const string &key)
void Write(CNcbiOstream &istr) const
bool DeleteField(const string &key)
CRegistryWriteView GetWriteView(const string §ion)
class CRegistryReadView provides a nested hierarchical view at a particular key.
int GetInt(const string &key, int default_val=0) const
access a named key at this level, with no recursion
double GetReal(const string &key, double default_val=0) const
bool GetBool(const string &key, bool default_val=false) const
void GetIntVec(const string &key, vector< int > &val) const
void GetRealVec(const string &key, vector< double > &val) const
string GetString(const string &key, const string &default_val=kEmptyStr) const
void GetStringVec(const string &key, vector< string > &val) const
CRegistryReadView GetReadView(const string §ion) const
static CConstRef< objects::CUser_field > ResolveField(list< CConstRef< objects::CUser_field > > &fields, const objects::CUser_field *meta)
const CUser_field & GetField(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const
Access a named field in this user field.
container_type::const_iterator const_iterator
const_iterator end() const
const_iterator find(const key_type &key) const
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Error(CExceptionArgs_Base &args)
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
const string & GetMsg(void) const
Get message string.
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
void SetData(TData &value)
Assign a value to Data data member.
vector< CStringUTF8 > TStrs
const struct ncbi::grid::netcache::search::fields::KEY key
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
static CNcbiRegistry * s_Registry
static const char * str(char *buf, int n)