NCBI C++ ToolKit
ns_util.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef NETSCHEDULE_NS_UTIL__HPP
2 #define NETSCHEDULE_NS_UTIL__HPP
3 
4 /* $Id: ns_util.hpp 68594 2015-08-18 14:43:35Z satskyse $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Victor Joukov
30  *
31  * File Description: Utility functions for NetSchedule
32  *
33  */
34 
35 #include "ns_types.hpp"
36 #include <corelib/ncbistl.hpp>
37 #include <corelib/ncbireg.hpp>
38 
39 
41 
42 
43 class IRegistry;
44 
45 
46 const string g_ValidPrefix = "Validating config file: ";
47 const string g_WarnPrefix = g_ValidPrefix + "unexpected value of ";
48 
49 
50 
51 // A few helpers
52 string NS_RegValName(const string & section, const string & entry);
53 bool NS_ValidateDouble(const IRegistry & reg,
54  const string & section, const string & entry,
55  vector<string> & warnings);
56 bool NS_ValidateBool(const IRegistry & reg,
57  const string & section, const string & entry,
58  vector<string> & warnings);
59 bool NS_ValidateInt(const IRegistry & reg,
60  const string & section, const string & entry,
61  vector<string> & warnings);
62 bool NS_ValidateString(const IRegistry & reg,
63  const string & section, const string & entry,
64  vector<string> & warnings);
65 bool NS_ValidateDataSize(const IRegistry & reg,
66  const string & section, const string & entry,
67  vector<string> & warnings);
68 unsigned int NS_GetDataSize(const IRegistry & reg,
69  const string & section, const string & entry,
70  unsigned int default_val);
71 
72 
73 
74 // Validates the config file and populates a warnings list if the file has
75 // problems.
76 void NS_ValidateConfigFile(const IRegistry & reg, vector<string> & warnings,
77  bool throw_port_exception,
78  bool & decrypting_error);
79 
80 string NS_GetConfigFileChecksum(const string & file_name,
81  vector<string> & warnings);
82 
83 
85 
86 #endif /* NETSCHEDULE_NS_UTIL__HPP */
87 
IRegistry –.
Definition: ncbireg.hpp:73
const char * file_name[]
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
Process information in the NCBI Registry, including working with configuration files.
The NCBI C++/STL use hints.
bool NS_ValidateDouble(const IRegistry &reg, const string &section, const string &entry, vector< string > &warnings)
Definition: ns_util.cpp:88
const string g_WarnPrefix
Definition: ns_util.hpp:47
void NS_ValidateConfigFile(const IRegistry &reg, vector< string > &warnings, bool throw_port_exception, bool &decrypting_error)
Definition: ns_util.cpp:190
bool NS_ValidateBool(const IRegistry &reg, const string &section, const string &entry, vector< string > &warnings)
Definition: ns_util.cpp:102
string NS_RegValName(const string &section, const string &entry)
Definition: ns_util.cpp:83
string NS_GetConfigFileChecksum(const string &file_name, vector< string > &warnings)
Definition: ns_util.cpp:605
unsigned int NS_GetDataSize(const IRegistry &reg, const string &section, const string &entry, unsigned int default_val)
Definition: ns_util.cpp:172
const string g_ValidPrefix
Definition: ns_util.hpp:46
bool NS_ValidateInt(const IRegistry &reg, const string &section, const string &entry, vector< string > &warnings)
Definition: ns_util.cpp:116
bool NS_ValidateDataSize(const IRegistry &reg, const string &section, const string &entry, vector< string > &warnings)
Definition: ns_util.cpp:145
bool NS_ValidateString(const IRegistry &reg, const string &section, const string &entry, vector< string > &warnings)
Definition: ns_util.cpp:130
Modified on Tue May 28 05:53:14 2024 by modify_doxy.py rev. 669887