NCBI C++ ToolKit
mafft_tool_params.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: mafft_tool_params.cpp 44360 2019-12-04 21:44:01Z katargir $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Roman Katargin, Vladislav Evgeniev
27  *
28  * File Description:
29  *
30  */
31 
32 #include <ncbi_pch.hpp>
33 
35 
38 
40 
42 {
43  Init();
44 }
45 
47 {
48  Init();
49  Copy(data);
50 }
51 
53 {
54 }
55 
57 {
58  Copy(data);
59 }
60 
62 {
63 ////@begin CMafftToolParams equality operator
64  if (!(m_AutoFlag == data.m_AutoFlag)) return false;
65  if (!(m_CommandLine == data.m_CommandLine)) return false;
66  if (!(m_MafftPath == data.m_MafftPath)) return false;
67  if (!(m_QuietFlag == data.m_QuietFlag)) return false;
68 ////@end CMafftToolParams equality operator
69  return true;
70 }
71 
73 {
74 ////@begin CMafftToolParams copy function
75  m_AutoFlag = data.m_AutoFlag;
76  m_CommandLine = data.m_CommandLine;
77  m_MafftPath = data.m_MafftPath;
78  m_QuietFlag = data.m_QuietFlag;
79 ////@end CMafftToolParams copy function
80  m_Objects = data.m_Objects;
81 }
82 
84 {
85 ////@begin CMafftToolParams member initialisation
86  m_AutoFlag = false;
87  m_QuietFlag = true;
88 ////@end CMafftToolParams member initialisation
89 }
90 
92 {
93  return FindExeFile(m_MafftPath);
94 }
95 
96 static const char
97 *kAutoFlag = "AutoFlag",
98 *kQuietMode = "QuietMode",
99 *kCommandLine = "CommandLine",
100 *kMafftPath = "GBENCH.Plugins.Algo.MAFFT.MafftPath";
101 
103 {
104  if (!m_RegPath.empty()) {
106  CRegistryWriteView view = gui_reg.GetWriteView(m_RegPath);
107 
109  view.Set(kQuietMode, m_QuietFlag);
110  view.Set(kAutoFlag, m_AutoFlag);
111  gui_reg.Set(kMafftPath, m_MafftPath.ToUTF8());
112  }
113 }
114 
116 {
117  if (!m_RegPath.empty()) {
119  CRegistryReadView view = gui_reg.GetReadView(m_RegPath);
120 
122  m_QuietFlag = view.GetBool(kQuietMode, true);
123  m_AutoFlag = view.GetBool(kAutoFlag, false);
124  m_MafftPath = wxString::FromUTF8(gui_reg.GetString(kMafftPath, string(m_MafftPath.ToUTF8())).c_str());
125  }
126 }
127 
CRegistryWriteView GetWriteView(const string &section)
get a read-write view at a particular level.
Definition: registry.cpp:462
static CGuiRegistry & GetInstance()
access the application-wide singleton
Definition: registry.cpp:400
void Set(const string &key, int val)
set specific values
Definition: registry.cpp:178
CRegistryReadView GetReadView(const string &section) const
get a read-only view at a particular level.
Definition: registry.cpp:428
string GetString(const string &key, const string &default_val=kEmptyStr) const
Definition: registry.cpp:148
class CRegistryReadView provides a nested hierarchical view at a particular key.
Definition: reg_view.hpp:58
bool GetBool(const string &key, bool default_val=false) const
Definition: reg_view.cpp:241
string GetString(const string &key, const string &default_val=kEmptyStr) const
Definition: reg_view.cpp:246
void Set(const string &key, int val)
access a named key at this level, with no recursion
Definition: reg_view.cpp:533
char data[12]
Definition: iconv.c:80
wxString GetMafftExecutable() const
TConstScopedObjects m_Objects
void operator=(const CMafftToolParams &data)
bool operator==(const CMafftToolParams &data) const
virtual void SaveSettings() const
void Copy(const CMafftToolParams &data)
virtual void LoadSettings()
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
static const char * kQuietMode
static const char * kCommandLine
static const char * kMafftPath
static const char * kAutoFlag
wxString ToWxString(const string &s)
Definition: wx_utils.hpp:173
string ToStdString(const wxString &s)
Definition: wx_utils.hpp:161
wxString FindExeFile(const wxString &exeFile)
Definition: wx_utils.cpp:76
Modified on Fri Sep 20 14:57:04 2024 by modify_doxy.py rev. 669887