44 #ifdef OPENMS_HAS_STREAM_EXTRACTION_BUG 45 #include <boost/lexical_cast.hpp> 46 #endif // OPENMS_HAS_STREAM_EXTRACTION_BUG 56 const std::string & string_1,
57 const char * string_1_stringified,
58 const std::string & string_2,
59 const char * string_2_stringified);
72 friend void OPENMS_DLLAPI
76 const std::string & string_1,
77 const char * string_1_stringified,
78 const std::string & string_2,
79 const char * string_2_stringified);
81 friend bool OPENMS_DLLAPI
111 const double & getAcceptableRelative()
const;
114 void setAcceptableRelative(
const double rhs);
117 const double & getAcceptableAbsolute()
const;
120 void setAcceptableAbsolute(
const double rhs);
132 void setMatchedWhitelist(
const std::vector< std::pair<std::string, std::string> >& rhs);
135 const std::vector< std::pair<std::string, std::string> >& getMatchedWhitelist()
const;
145 const int & getVerboseLevel()
const;
155 void setVerboseLevel(
const int rhs);
160 const int & getTabWidth()
const;
165 void setTabWidth(
const int rhs);
170 const int & getFirstColumn()
const;
175 void setFirstColumn(
const int rhs);
183 std::ostream & getLogDestination()
const;
195 void setLogDestination(std::ostream & rhs);
204 bool compareStrings(std::string
const & lhs, std::string
const & rhs);
214 bool compareStreams(std::istream & input_1, std::istream & input_2);
230 bool compareFiles(
const std::string & filename_1,
231 const std::string & filename_2);
243 bool compareLines_(std::string
const & line_str_1, std::string
const & line_str_2);
246 void reportSuccess_()
const;
250 void reportFailure_(
char const *
const message)
const;
253 void writeWhitelistCases_(
const std::string & prefix)
const;
257 void readNextLine_(std::istream & input_stream, std::string & line_string,
int & line_number)
const;
260 bool openInputFileStream_(
const std::string & filename, std::ifstream & input_stream)
const;
279 void setToString(
const std::string & s);
282 void updatePosition();
285 void seekGToSavedPosition();
333 #ifdef OPENMS_HAS_STREAM_EXTRACTION_BUG 343 bool readdigits(
InputLine & input_line, std::string & target_buffer,
char & c_buffer);
352 bool tryExtractDouble(
InputLine & input_line,
double & target);
354 void fillFromInputLine(
InputLine & input_line);
StreamElement_ element_2_
Stores information about characters, numbers, and white spaces loaded from the second input stream...
Definition: FuzzyStringComparator.h:361
int verbose_level_
Definition: FuzzyStringComparator.h:375
void testStringSimilar(const char *file, int line, const std::string &string_1, const char *string_1_stringified, const std::string &string_2, const char *string_2_stringified)
Compare strings using absdiff_max_allowed and ratio_max_allowed.
A more convenient string class.
Definition: String.h:57
Internal exception class.
Definition: FuzzyStringComparator.h:86
double ratio_max_allowed_
Maximum ratio of numbers allowed, see ratio_max_.
Definition: FuzzyStringComparator.h:310
Stores information about characters, numbers, and white spaces loaded from the InputStream.
Definition: FuzzyStringComparator.h:322
double absdiff_max_
Maximum difference of numbers observed so far, see absdiff_max_allowed_.
Definition: FuzzyStringComparator.h:319
int line_column
Definition: FuzzyStringComparator.h:368
double absdiff_max_allowed_
Maximum absolute difference of numbers allowed, see absdiff_max_.
Definition: FuzzyStringComparator.h:316
OpenMS::String prefix
Definition: FuzzyStringComparator.h:366
bool use_prefix_
use a prefix when reporting
Definition: FuzzyStringComparator.h:386
std::ostream * log_dest_
Log and results output goes here.
Definition: FuzzyStringComparator.h:263
void setWhitelist(const char *const, const int line, const std::string &whitelist)
set the whitelist_
std::vector< std::pair< std::string, std::string > > matched_whitelist_
Alternative Whitelist.
Definition: FuzzyStringComparator.h:394
unsigned char letter
Definition: FuzzyStringComparator.h:325
bool is_space
Definition: FuzzyStringComparator.h:327
Fuzzy comparison of strings, tolerates numeric differences.
Definition: FuzzyStringComparator.h:69
std::string line_str_2_max_
Definition: FuzzyStringComparator.h:307
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
int line_num_2_
Definition: FuzzyStringComparator.h:301
std::map< String, UInt > whitelist_cases_
Occurrences of whitelist entries.
Definition: FuzzyStringComparator.h:391
bool is_number
Definition: FuzzyStringComparator.h:326
OpenMS::String prefix_whitespaces
Definition: FuzzyStringComparator.h:367
double number
Definition: FuzzyStringComparator.h:324
int first_column_
Definition: FuzzyStringComparator.h:377
int tab_width_
Definition: FuzzyStringComparator.h:376
double ratio_max_
Maximum ratio of numbers observed so far, see ratio_max_allowed_.
Definition: FuzzyStringComparator.h:313
int line_num_1_
Definition: FuzzyStringComparator.h:300
StreamElement_ element_1_
Stores information about characters, numbers, and white spaces loaded from the first input stream...
Definition: FuzzyStringComparator.h:359
StringList whitelist_
Whitelist.
Definition: FuzzyStringComparator.h:389
InputLine input_line_2_
Definition: FuzzyStringComparator.h:298
bool is_status_success_
Has comparison been successful so far? Note: this flag is changed in reportFailure_();.
Definition: FuzzyStringComparator.h:383
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:73
std::string input_2_name_
Name of second input e.g., filename.
Definition: FuzzyStringComparator.h:268
int line_num_1_max_
Definition: FuzzyStringComparator.h:303
std::string line_str_1_max_
Definition: FuzzyStringComparator.h:306
bool isFileSimilar(const std::string &filename_1, const std::string &filename_2)
Compare files using absdiff_max_allowed and ratio_max_allowed.
bool is_absdiff_small_
Definition: FuzzyStringComparator.h:373
Wrapper for the prefix information computed for the failure report.
Definition: FuzzyStringComparator.h:364
int line_num_2_max_
Definition: FuzzyStringComparator.h:304
InputLine input_line_1_
Definition: FuzzyStringComparator.h:297
std::string input_1_name_
Name of first input e.g., filename.
Definition: FuzzyStringComparator.h:266