registered =
false;
104 const string& name = prototype->
GetName();
109 stringltool_id = tool_id;
110 if(ltool_id.empty())
122 ERR_POST(
"CUIToolRegistry::RegisterTool() - "<< name <<
123 " method already registered");
136 ERR_POST(
"CUIToolRegistry::RegisterTemplateTool() - class "<<
137class_name <<
" already registred");
144 ERR_POST(
"CUIToolRegistry::RegisterTemplateTool() - prototype " 145<<
" does implement IUITool interface.");
157 static const char*
kRegTag=
"Scoring Tool Registry";
164 if( !wxFileName::DirExists(path_name) ) {
165 LOG_POST(
Info<<
kRegTag<<
": Directory \""<< path_name.ToUTF8() <<
"\" does not exist");
171wxFileName fname(path_name, wxEmptyString);
172wxDir dir(path_name);
173 boolcont = dir.GetFirst(&filename, wxEmptyString, wxDIR_FILES);
175fname.SetFullName(filename);
177cont = dir.GetNext(&filename);
184 static const char*
kInvalidDef=
" - invalid method definition: ";
193 ERR_POST(
kRegTag<<
" - failed to read alignment scoring method: "<< full_path.ToUTF8());
200 stringtool_class = reg.
GetString(
"Info",
"Tool",
"");
201 if(tool_class.empty()) {
203tool_class = reg.
GetString(
"Info",
"Method",
"");
209<<
"\" is not registered. Definition file: "<< full_path.ToUTF8());
213 stringtool_id = reg.
GetString(
"Info",
"Id",
"");
214 if(tool_id.empty()) {
215tool_id = wxFileName::FileName(full_path).GetFullName();
219<<
" is already registered. Definition file: "<< full_path.ToUTF8());
227 if(method->LoadInfo(reg)) {
228 stringmethod_name = clone->
GetName();
231 if(method_name.empty()) {
240<<
" is already registered. Definition file: "<< full_path.ToUTF8());
255}
catch(std::exception& e) {
263 const static char*
kFailedToRead=
" - failed to read alignment scoring method: ";
266 constwxString& full_path)
272<<
"cannot open file \""<< full_path.ToUTF8() <<
"\"");
284}
catch(std::exception& e) {
289<<
" in \""<< full_path.ToUTF8() <<
"\"");
299 names.push_back(it_r->first);
314 names.push_back(it_r->first);
327 if(selector.
Select(tool)) {
340tool_id = it_name->second;
347 stringtool_id = name;
351tool_id = it_r->second;
356 returnit->second.get();
365 returnrec->
m_Tool->GetDescription();
367 static stringdescr(
"not implemented");
418 ERR_POST(
"CUIToolRegistry::CreateMRUList() - MRU list "+ list +
" already exists.");
435 ERR_POST(
"CUIToolRegistry::SetMaxMRUSize() - the provided value "<<
436 size<<
" is out of range.");
438it->second.SetMaxSize(
size);
442 ERR_POST(
"CUIToolRegistry::SetMaxMRUSize() - the list "<< list <<
" does not exist");
452 ERR_POST(
"CUIToolRegistry::SetMRUToolNames() - the list "<< list_name
453<<
" does not exist");
457 ITERATE(vector<string>, it_n, tool_names) {
458 const string& name = *it_n;
460 tmp.push_back(name);
464it->second.SetItems(
tmp);
474 ERR_POST(
"CUIToolRegistry::SetMRUToolNames() - the list "<< list_name <<
478 constlist<string>& items = mru.
GetItems();
481 std::copy(items.begin(), items.end(), back_inserter(tool_names));
491 ERR_POST(
"CUIToolRegistry::SetMRUToolNames() - the list "<< list_name <<
494it->second.AddItem(tool_name);
519 _ASSERT(
key.type == objects::CUser_field::C_Data::e_Strs);
521 stringlist_name =
key.key;
522vector<string>
names;
530 ERR_POST(
"CUIToolRegistry::LoadSettings() - empty registry path.");
543 const string& list_name = it->first;
546 constlist<string>& items = mru.
GetItems();
548mru_view.
Set(list_name, items);
552 ERR_POST(
"CUIToolRegistry::LoadSettings() - empty registry path.");
static string MakeKey(const string §ion, const string &key, const string &delim=CGuiRegistry::kDecimalDot)
create a key from a section and a subkey
CRegistryWriteView GetWriteView(const string §ion)
get a read-write view at a particular level.
static CGuiRegistry & GetInstance()
access the application-wide singleton
CRegistryReadView GetReadView(const string §ion) const
get a read-only view at a particular level.
const TItems & GetItems() const
class CRegistryReadView provides a nested hierarchical view at a particular key.
list< SKeyInfo > TKeys
retrieve information about all keys in the registry
void GetStringVec(const string &key, vector< string > &val) const
void GetKeys(TKeys &keys) const
Retrieve information about all keys in this view.
CRegistryWriteView GetWriteView(const string §ion)
void Set(const string &key, int val)
access a named key at this level, with no recursion
static wxString ResolvePath(const wxString &path, const wxString &rel_name)
Utility function to hide the platform specifics of locating our standard directories and files.
container_type::const_iterator const_iterator
container_type::iterator iterator
const_iterator end() const
const_iterator find(const key_type &key) const
iterator_bool insert(const value_type &val)
Include a standard set of the NCBI C++ Toolkit most basic headers.
static const struct name_t names[]
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
const string & GetMsg(void) const
Get message string.
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
void Info(CExceptionArgs_Base &args)
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
void Reset(void)
Reset reference object.
bool ReferencedOnlyOnce(void) const THROWS_NONE
Check if object is referenced only once.
virtual string GetString(const string §ion, const string &name, const string &default_value, TFlags flags=0) const
Get the parameter string value.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
const struct ncbi::grid::netcache::search::fields::SIZE size
const struct ncbi::grid::netcache::search::fields::KEY key
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...
Process information in the NCBI Registry, including working with configuration files.
The NCBI C++/STL use hints.
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4