changed =
false;
98 template<
typenameC>
101 boolchanged =
false;
102 typenameC::iterator it = str_cont.begin();
103 while(it != str_cont.end()) {
108it = str_cont.erase(it);
117 template<
typenameC>
120 boolchanged =
false;
121 typenameC::iterator it = str_cont.begin();
122 while(it != str_cont.end()) {
127it = str_cont.erase(it);
144 template<
typenameCont>
147 boolchanged =
false;
148 typedef typenameCont::iterator iterator;
149iterator l_it =
l.begin();
150 while(l_it !=
l.end()) {
151iterator dup_it = case_insensitive ?
153find(
l.begin(), l_it, *l_it );
154 if(dup_it != l_it) {
155l_it =
l.erase(l_it);
165 #define TRUNCATE_SPACES(o, x) \ 166 if ((o).IsSet##x()) { \ 167 size_t n = (o).Get##x().size(); \ 168 NStr::TruncateSpacesInPlace((o).Set##x()); \ 169 if (n != (o).Get##x().size() ) { \ 170 ChangeMade(CCleanupChange::eTrimSpaces); \ 172 if (NStr::IsBlank((o).Get##x())) { \ 174 ChangeMade(CCleanupChange::eTrimSpaces); \ 178 #define TRUNCATE_CHOICE_SPACES(o, x) \ 180 size_t n = (o).Get##x().size(); \ 181 NStr::TruncateSpacesInPlace((o).Set##x()); \ 182 if (n != (o).Get##x().size() ) { \ 183 ChangeMade(CCleanupChange::eTrimSpaces); \ 185 if (NStr::IsBlank((o).Get##x())) { \ 187 ChangeMade(CCleanupChange::eTrimSpaces); \ 191 #define CONVERT_QUOTES(x) \ 193 if (ConvertDoubleQuotes(Set##x()) ) { \ 194 ChangeMade(CCleanupChange::eCleanDoubleQuotes); \ 198 #define COMPRESS_STRING_MEMBER(o, x) \ 199 if ((o).IsSet##x()) { \ 200 const size_t old_len = (o).Set##x().length(); \ 201 CompressSpaces((o).Set##x()); \ 202 if( old_len != (o).Set##x().length() ) { \ 203 ChangeMade(CCleanupChange::eTrimSpaces); \ 205 if (NStr::IsBlank((o).Get##x())) { \ 207 ChangeMade(CCleanupChange::eTrimSpaces); \ 211 #define CLEAN_STRING_MEMBER(o, x) \ 212 if ((o).IsSet##x()) { \ 213 if (CleanVisString((o).Set##x()) ) { \ 214 ChangeMade(CCleanupChange::eTrimSpaces); \ 216 if (NStr::IsBlank((o).Get##x())) { \ 218 ChangeMade(CCleanupChange::eTrimSpaces); \ 223 #define CLEAN_AND_COMPRESS_STRING_MEMBER(o, x) \ 224 do { COMPRESS_STRING_MEMBER(o, x); CLEAN_STRING_MEMBER(o, x); } while(false) 226 #define CLEAN_STRING_MEMBER_JUNK(o, x) \ 227 if ((o).IsSet##x()) { \ 228 if (CleanVisStringJunk((o).Set##x()) ) { \ 229 ChangeMade(CCleanupChange::eTrimSpaces); \ 231 if (NStr::IsBlank((o).Get##x())) { \ 233 ChangeMade(CCleanupChange::eTrimSpaces); \ 238 #define CLEAN_AND_COMPRESS_STRING_MEMBER_JUNK(o, x) \ 239 do { COMPRESS_STRING_MEMBER(o, x); CLEAN_STRING_MEMBER_JUNK(o, x); } while(false) 241 #define EXTENDED_CLEAN_STRING_MEMBER(o, x) \ 242 if ((o).IsSet##x()) { \ 243 CleanVisString((o).Set##x()); \ 244 if (NStr::IsBlank((o).Get##x())) { \ 246 ChangeMade(CCleanupChange::eTrimSpaces); \ 250 #define CLEAN_STRING_CHOICE(o, x) \ 251 if (CleanVisString((o).Set##x()) ) { \ 252 ChangeMade(CCleanupChange::eTrimSpaces); \ 254 if (NStr::IsBlank((o).Get##x())) { \ 256 ChangeMade(CCleanupChange::eTrimSpaces); \ 259 #define CLEAN_STRING_LIST(o, x) \ 260 if ((o).IsSet##x()) { \ 261 if (CleanVisStringContainer((o).Set##x()) ) { \ 262 ChangeMade(CCleanupChange::eTrimSpaces); \ 264 if ((o).Get##x().empty()) { \ 266 ChangeMade(CCleanupChange::eTrimSpaces); \ 270 #define CLEAN_STRING_LIST_JUNK(o, x) \ 271 if ((o).IsSet##x()) { \ 272 if (CleanVisStringContainerJunk((o).Set##x()) ) { \ 273 ChangeMade(CCleanupChange::eTrimSpaces); \ 275 if ((o).Get##x().empty()) { \ 277 ChangeMade(CCleanupChange::eTrimSpaces); \ 281 #define EXTENDED_CLEAN_STRING_LIST(o, x) \ 282 if ((o).IsSet##x()) { \ 283 CleanVisStringList((o).Set##x()); \ 284 if ((o).Get##x().empty()) { \ 286 ChangeMade(CCleanupChange::eTrimSpaces); \ 291 #define CLEAN_INTERNAL_STRING(o, x) \ 292 if (o.IsSet##x()) { \ 293 if ( CleanVisString(o.Set##x()) ) { \ 294 ChangeMade(CCleanupChange::eTrimSpaces); \ 296 if (NStr::IsBlank(o.Get##x())) { \ 298 ChangeMade(CCleanupChange::eTrimSpaces); \ 302 #define MERGEABLE_STRING_VALUE(o1, o2, x) \ 303 if ((o1).CanGet##x() && (o2).CanGet##x() \ 304 && !NStr::IsBlank ((o1).Get##x()) \ 305 && !NStr::IsBlank ((o2).Get##x()) \ 306 && !NStr::Equal ((o1).Get##x(), (o2).Get##x())) { \ 310 #define MERGEABLE_STRING_LIST(o1, o2, x) \ 311 if ((o1).CanGet##x() && (o2).CanGet##x() \ 312 && (o1).Get##x().size() > 0 \ 313 && (o2).Get##x().size() > 0) { \ 314 list <string>::const_iterator it1 = (o1).Get##x().begin(); \ 315 list <string>::const_iterator it2 = (o2).Get##x().begin(); \ 316 while (it1 != (o1).Get##x().end() && it2 != (o2).Get##x().end()) { \ 317 if (!NStr::Equal ((*it1), (*it2))) { \ 322 if (it1 != (o1).Get##x().end() || it2 != (o2).Get##x().end()) { \ 327 #define MERGEABLE_INT_VALUE(o1, o2, x) \ 328 (!(o1).CanGet##x() || !(o2).CanGet##x() \ 329 || (o1).Get##x() == 0 \ 330 || (o2).Get##x() == 0 \ 331 || (o1).Get##x() == (o2).Get##x()) 333 #define MATCH_STRING_VALUE(o1, o2, x) \ 334 ((!(o1).CanGet##x() && !(o2).CanGet##x()) \ 335 || ((o1).CanGet##x() && (o2).CanGet##x() \ 336 && NStr::Equal((o1).Get##x(), (o2).Get##x()))) 338 #define MATCH_STRING_LIST(o1, o2, x) \ 339 if (((o1).CanGet##x() && (o1).Get##x().size() > 0 && !(o2).CanGet##x()) \ 340 || (!(o1).CanGet##x() && (o2).CanGet##x() && (o2).Get##x().size() > 0)) { \ 342 } else if ((o1).CanGet##x() && (o2).CanGet##x()) { \ 343 list <string>::const_iterator it1 = (o1).Get##x().begin(); \ 344 list <string>::const_iterator it2 = (o2).Get##x().begin(); \ 345 while (it1 != (o1).Get##x().end() && it2 != (o2).Get##x().end()) { \ 346 if (!NStr::Equal ((*it1), (*it2))) { \ 351 if (it1 != (o1).Get##x().end() || it2 != (o2).Get##x().end()) { \ 356 #define MATCH_INT_VALUE(o1, o2, x) \ 357 ((!(o1).CanGet##x() && !(o2).CanGet##x()) \ 358 || ((o1).CanGet##x() && (o2).CanGet##x() \ 359 && (o1).Get##x() == (o2).Get##x()) \ 360 || ((o1).CanGet##x() && (o1).Get##x() == 0 \ 361 && !(o2).CanGet##x()) \ 362 || ((o2).CanGet##x() && (o2).Get##x() == 0 \ 363 && !(o1).CanGet##x())) 365 #define MATCH_BOOL_VALUE(o1, o2, x) \ 366 if (!(o1).IsSet##x()) { \ 367 if ((o2).IsSet##x()) { \ 370 } else if (!(o2).IsSet##x()) { \ 372 } else if (((o1).Get##x() && !(o2).Get##x()) \ 373 || (!(o2).Get##x() && (o2).Get##x())) { \ 395 template<
classIter,
classComp>
412 template<
classIter>
@Auth_list.hpp User-defined methods of the data storage class.
@Pubdesc.hpp User-defined methods of the data storage class.
bool RemoveSpacesBetweenTildes(string &str)
remove white space between pairs of tildes.
bool is_sorted(Iter first, Iter last, Comp comp)
bool CleanVisStringContainer(C &str_cont)
bool CleanDoubleQuote(string &str)
Change double to single quotes.
bool RemoveDupsNoSort(Cont &l, bool case_insensitive=false)
bool CleanVisString(string &str)
bool CleanVisStringContainerJunk(C &str_cont)
CRef< CSeq_loc > ReadLocFromText(const string &text, const CSeq_id *id, CScope *scope)
bool s_OrgrefSynCompare(const string &syn1, const string &syn2)
bool s_DbtagEqual(const CRef< CDbtag > &dbt1, const CRef< CDbtag > &dbt2)
void TrimInternalSemicolons(string &str)
remove duplicate internal semicolons.
bool s_DbtagCompare(const CRef< CDbtag > &dbt1, const CRef< CDbtag > &dbt2)
char x_ValidAminoAcid(string_view abbrev)
bool s_OrgrefSynEqual(const string &syn1, const string &syn2)
bool RemoveSpaces(string &str)
remove all spaces from a string
bool Asn2gnbkCompressSpaces(string &val)
weird space compression from C Toolkit
bool TrimSpacesSemicolonsAndCommas(string &val)
bool CleanVisStringJunk(string &str, bool allow_ellipses=false)
bool ConvertDoubleQuotes(string &str)
Cleaning functions may return true if they have changed something.
Include a standard set of the NCBI C++ Toolkit most basic headers.
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
static DLIST_TYPE *DLIST_NAME() last(DLIST_LIST_TYPE *list)
static DLIST_TYPE *DLIST_NAME() next(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
static const char * str(char *buf, int n)
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
static void text(MDB_val *v)
static SLJIT_INLINE sljit_ins l(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
SCaseInsensitiveStrComp(const string &str)
bool operator()(string &s)
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