61 if (
this != &resolver) {
77 return string(define, 2, define.length() - 3);
83 resolved_def->clear();
88 string::size_type start,
prev, end;
89 for (start=0,
prev=start-1; ;
prev=start) {
91 if (start == string::npos) {
96 end =
data.find(
")", start);
97 if (end == string::npos) {
99 resolved_def->push_back(define);
102 string raw_define =
data.substr(start,end-start+1);
111 *resolved_def = m->second;
116 ITERATE(list<string>,
n, p->second) {
117 list<string> new_resolved_def;
119 copy(new_resolved_def.begin(),
120 new_resolved_def.end(),
121 back_inserter(*resolved_def));
126 resolved_def->push_back(
tmp);
129 m_Cache[str_define] = *resolved_def;
131 if ( !resolved_def->empty() ) {
134 if ( resolved_def->size() == 1) {
137 raw_define != resolved_def->front() ? resolved_def->front() :
kEmptyStr);
138 resolved_def->clear();
141 if (resolved_def->empty() && !
data.empty()) {
142 resolved_def->push_back(
data);
149 resolved_def->clear();
151 bool modified =
true;
154 string::size_type start,
prev, end;
155 for (start=0,
prev=start-1; ;
prev=start) {
157 if (start == string::npos) {
162 end =
data.find(
")", start);
163 if (end == string::npos) {
165 resolved_def->push_back(define);
168 string raw_define =
data.substr(start,end-start+1);
170 string val_define =
FilterDefine(raw_define, exprule, mdata);
176 ITERATE(list<string>,
n, p->second) {
177 list<string> new_resolved_def;
178 Resolve(*
n, &new_resolved_def, mdata);
179 copy(new_resolved_def.begin(),
180 new_resolved_def.end(),
181 back_inserter(*resolved_def));
184 if ( resolved_def->empty() ) {
185 Resolve(raw_define, resolved_def);
189 if ( resolved_def->size() == 1) {
192 if (raw_define == resolved_def->front()) {
193 if (
GetApp().GetSite().IsCppflagDescribed(raw_define)) {
203 raw_define != resolved_def->front() ? resolved_def->front() :
kEmptyStr);
205 resolved_def->clear();
208 if (resolved_def->empty() && !
data.empty()) {
209 resolved_def->push_back(
data);
225 redefs.push_back(
i->first);
227 "Attempt to redefine already defined macro: " <<
i->first);
245 string suff[] = {
"-dll",
"-static",
""};
246 for (
int i = 0; !suff[
i].empty(); ++
i) {
268 return (param.find(
"$(") != string::npos && param.find(
")") != string::npos );
273 string::size_type start, end;
274 string trimmed( define);
275 while ((start = trimmed.find(
"$(")) != string::npos) {
276 end = trimmed.rfind(
")");
277 if (end == string::npos) {
280 trimmed.erase(start,end);
332 for(string::const_iterator p = define.begin(); p != define.end(); ++p) {
338 isdigit((
unsigned char) ch) ) )
354 string::size_type start = define.find(
':');
355 string::size_type end = define.rfind(
')');
356 if (start != string::npos && end != string::npos && end > start) {
357 string textrule = define.substr(start+1, end-start-1);
359 string toreplace(
":");
360 toreplace += textrule;
383 if (
this != &other) {
418 }
else if (
value[0] ==
'$') {
440 if (!begins.empty()) {
454 for (list<string>::iterator
i =
value.begin();
i !=
value.end(); ++
i) {
CExpansionRule & operator=(const CExpansionRule &other)
string ApplyRule(const string &value) const
void Init(const string &textrule, CSymResolver *resolver=NULL, const CSimpleMakeFileContents *data=NULL)
string GetConfigureMacro(string data)
CSimpleMakeFileContents –.
static void LoadFrom(const string &file_path, CSimpleMakeFileContents *fc)
bool HasDefinition(const string &key) const
const string & GetFileName(void) const
void AddDefinition(const string &key, const string &value)
static string TrimDefine(const string &define)
void Resolve(const string &define, list< string > *resolved_def)
void AddDefinition(const string &key, const string &value)
CSymResolver & Append(const CSymResolver &src, bool warn_redef=false)
void SetFrom(const CSymResolver &resolver)
static string StripDefine(const string &define)
static void LoadFrom(const string &file_path, CSymResolver *resolver)
CSimpleMakeFileContents m_Data
static bool HasDefine(const string ¶m)
CSimpleMakeFileContents::TContents m_Cache
static bool StripSuffix(string &libname, string *suffix=nullptr)
string FilterDefine(const string &define, CExpansionRule &rule, const CSimpleMakeFileContents &data)
static bool IsDefine(const string ¶m)
bool HasDefinition(const string &key) const
CSymResolver & operator=(const CSymResolver &resolver)
container_type::const_iterator const_iterator
const_iterator begin() const
const_iterator end() const
const_iterator find(const key_type &key) const
iterator_bool insert(const value_type &val)
const_iterator find(const key_type &key) const
const_iterator end() const
The NCBI C++ standard methods for dealing with std::string.
static DLIST_TYPE *DLIST_NAME() prev(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static SIZE_TYPE FindNoCase(const CTempString str, const CTempString pattern, SIZE_TYPE start, SIZE_TYPE end, EOccurrence which=eFirst)
Find the pattern in the specified range of a string using a case insensitive search.
static bool EndsWith(const CTempString str, const CTempString end, ECase use_case=eCase)
Check if a string ends with a specified suffix value.
static SIZE_TYPE Find(const CTempString str, const CTempString pattern, ECase use_case=eCase, EDirection direction=eForwardSearch, SIZE_TYPE occurrence=0)
Find the pattern in the string.
static string Join(const TContainer &arr, const CTempString &delim)
Join strings using the specified delimiter.
static string & Replace(const string &src, const string &search, const string &replace, string &dst, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
static SIZE_TYPE FindCase(const CTempString str, const CTempString pattern, SIZE_TYPE start, SIZE_TYPE end, EOccurrence which=eFirst)
Find the pattern in the specified range of a string using a case sensitive search.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
static bool SplitInTwo(const CTempString str, const CTempString delim, string &str1, string &str2, TSplitFlags flags=0)
Split a string into two pieces using the specified delimiters.
static string & ReplaceInPlace(string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
static string TruncateSpaces(const string &str, ETrunc where=eTrunc_Both)
Truncate whitespace in a string.
@ eReverseSearch
Search in a backward direction.
@ eCase
Case sensitive compare.
const struct ncbi::grid::netcache::search::fields::KEY key
const GenericPointer< typename T::ValueType > T2 value
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
CProjBulderApp & GetApp(void)
access to App singleton
@ ePTB_ConfigurationError
#define PTB_WARNING_EX(file, err_code, msg)
string FilterDefine(const string &define)