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

Go to the SVN repository for this file.

1 /* $Id: fasta_load_params.cpp 47293 2022-12-21 00:33:47Z evgeniev $
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
27  */
28 
29 
30 #include <ncbi_pch.hpp>
31 
33 
35 
37 
38 /*!
39  * CFastaLoadParams type definition
40  */
41 
42 /*!
43  * Default constructor for CFastaLoadParams
44  */
45 
47 {
48  Init();
49 }
50 
51 /*!
52  * Copy constructor for CFastaLoadParams
53  */
54 
56 {
57  Init();
58  Copy(data);
59 }
60 
61 /*!
62  * Destructor for CFastaLoadParams
63  */
64 
66 {
67 }
68 
69 /*!
70  * Assignment operator for CFastaLoadParams
71  */
72 
74 {
75  Copy(data);
76 }
77 
78 /*!
79  * Equality operator for CFastaLoadParams
80  */
81 
83 {
84 ////@begin CFastaLoadParams equality operator
85  if (!(m_ForceLocalIDs == data.m_ForceLocalIDs)) return false;
86  if (!(m_IgnoreGaps == data.m_IgnoreGaps)) return false;
87  if (!(m_LowercaseOption == data.m_LowercaseOption)) return false;
88  if (!(m_MakeDelta == data.m_MakeDelta)) return false;
89  if (!(m_NoSplit == data.m_NoSplit)) return false;
90  if (!(m_ReadFirst == data.m_ReadFirst)) return false;
91  if (!(m_SeqType == data.m_SeqType)) return false;
92  if (!(m_SkipInvalid == data.m_SkipInvalid)) return false;
93 ////@end CFastaLoadParams equality operator
94  return true;
95 }
96 
97 /*!
98  * Copy function for CFastaLoadParams
99  */
100 
102 {
103 ////@begin CFastaLoadParams copy function
104  m_ForceLocalIDs = data.m_ForceLocalIDs;
105  m_IgnoreGaps = data.m_IgnoreGaps;
106  m_LowercaseOption = data.m_LowercaseOption;
107  m_MakeDelta = data.m_MakeDelta;
108  m_NoSplit = data.m_NoSplit;
109  m_ReadFirst = data.m_ReadFirst;
110  m_SeqType = data.m_SeqType;
111  m_SkipInvalid = data.m_SkipInvalid;
112 ////@end CFastaLoadParams copy function
113 }
114 
115 /*!
116  * Member initialisation for CFastaLoadParams
117  */
118 
120 {
121 ////@begin CFastaLoadParams member initialisation
122  m_ForceLocalIDs = false;
123  m_IgnoreGaps = false;
124  m_LowercaseOption = 0;
125  m_MakeDelta = false;
126  m_NoSplit = false;
127  m_ReadFirst = false;
128  m_SeqType = 0;
129  m_SkipInvalid = true;
130 ////@end CFastaLoadParams member initialisation
131 }
132 
133 static const char
134 *kSeqTypeTag = "SeqType",
135 *kLowercaseOptionTag = "LowercaseOption",
136 *kForceLocalIDsTag = "ForceLocalIDs",
137 *kMakeDeltaTag = "MakeDelta",
138 *kIgnoreGaps = "IgnoreGaps",
139 *kReadFirstTag = "ReadFirst",
140 *kSkipInvalidTag = "SkipInvalid",
141 *kNoSplit = "NoSplit";
142 
143 /// IRegSettings
145 {
146  if (!m_RegPath.empty()) {
148  CRegistryWriteView view = gui_reg.GetWriteView(m_RegPath);
149 
150  view.Set(kSeqTypeTag, m_SeqType);
152 
158  view.Set(kNoSplit, m_NoSplit);
159  }
160 }
161 
163 {
164  if (!m_RegPath.empty()) {
166  CRegistryReadView view = gui_reg.GetReadView(m_RegPath);
167 
170 
177  }
178 }
179 
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
CRegistryReadView GetReadView(const string &section) const
get a read-only view at a particular level.
Definition: registry.cpp:428
class CRegistryReadView provides a nested hierarchical view at a particular key.
Definition: reg_view.hpp:58
int GetInt(const string &key, int default_val=0) const
access a named key at this level, with no recursion
Definition: reg_view.cpp:230
bool GetBool(const string &key, bool default_val=false) const
Definition: reg_view.cpp:241
void Set(const string &key, int val)
access a named key at this level, with no recursion
Definition: reg_view.cpp:533
static const char * kLowercaseOptionTag
static const char * kNoSplit
static const char * kReadFirstTag
static const char * kForceLocalIDsTag
static const char * kSeqTypeTag
static const char * kIgnoreGaps
static const char * kMakeDeltaTag
static const char * kSkipInvalidTag
char data[12]
Definition: iconv.c:80
bool operator==(const CFastaLoadParams &data) const
Equality operator for CFastaLoadParams.
void Init()
Initialises member variables.
~CFastaLoadParams()
Destructor for CFastaLoadParams.
virtual void SaveSettings() const
IRegSettings.
void Copy(const CFastaLoadParams &data)
Copy function for CFastaLoadParams.
CFastaLoadParams()
Default constructor for CFastaLoadParams.
void operator=(const CFastaLoadParams &data)
Assignment operator for CFastaLoadParams.
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
Modified on Fri Sep 20 14:57:39 2024 by modify_doxy.py rev. 669887