From dbee1757e1257c56f9cc5c592795975d26c06182 Mon Sep 17 00:00:00 2001 From: Marcus Belcastro Date: Fri, 4 Sep 2020 20:48:06 +1000 Subject: [PATCH 1/8] Added unit test for XML parser Added only good data parsing, no abnormal or corrupted data is parsed here. --- tests/unit-tests/lib/test_parse.cpp | 395 +++++++++++++++++++++++++++- 1 file changed, 382 insertions(+), 13 deletions(-) diff --git a/tests/unit-tests/lib/test_parse.cpp b/tests/unit-tests/lib/test_parse.cpp index 1a63546377c..c13c1746690 100644 --- a/tests/unit-tests/lib/test_parse.cpp +++ b/tests/unit-tests/lib/test_parse.cpp @@ -4,42 +4,226 @@ #include #include +#define SML_BUF_LEN 32 +#define MED_BUF_LEN 64 +#define LRG_BUF_LEN 1024 +#define TEST_XML_FILE_NAME_GOOD "test_good.xml" +#define TEST_XML_FILE_NAME_BAD "test_bad.xml" +#define TEST_XML_DATA_GOOD " \ + this is the start \ + foo data \ + 12345 \ + -54321 \ + 1.2345 \ + -5.4321 \ + 1 \ + \ + 8589934592 \ + FOO" + using namespace std; namespace test_parse { - // The fixture for testing class Foo. - + // The fixture for testing parse.h/parse.cpp class test_parse : public ::testing::Test { protected: - // You can remove any or all of the following functions if its body - // is empty. + FILE* xml_test_file_good; // The file with perfect data for testing correctness + FILE* xml_test_file_bad; // The file with bad data for testing error handling + // MIOFILES are needed for XML_PARSERs + MIOFILE* good_miofile; + MIOFILE* bad_miofile; + XML_PARSER* good_parser; + XML_PARSER* bad_parser; test_parse() { - // You can do set-up work for each test here. + // Make testing files for the XML parser + string file_data_good = TEST_XML_DATA_GOOD; + //string file_data_bad = TEST_XML_DATA_BAD; + + xml_test_file_good = fopen(TEST_XML_FILE_NAME_GOOD, "w+"); + //xml_test_file_bad = fopen(TEST_XML_FILE_NAME_BAD, "w+"); + + assert(xml_test_file_good); + assert(EOF != fputs(file_data_good.c_str(), xml_test_file_good)); + //assert(xml_test_file_bad); + //assert(EOF != fputs(file_data_bad.c_str(), xml_test_file_bad)); + + // Create the MIOFILE objects + good_miofile = new MIOFILE; + //bad_miofile = new MIOFILE; + good_miofile->init_file(xml_test_file_good); + //bad_miofile.init_file(xml_test_file_bad); } virtual ~test_parse() { - // You can do clean-up work that doesn't throw exceptions here. + fclose(xml_test_file_good); + //fclose(xml_test_file_bad); + delete good_miofile; + //delete bad_miofile; + + // Remove the files after testing + remove(TEST_XML_FILE_NAME_GOOD); + //remove(TEST_XML_FILE_NAME_BAD); } // If the constructor and destructor are not enough for setting up // and cleaning up each test, you can define the following methods: virtual void SetUp() { - // Code here will be called immediately after the constructor (right - // before each test). + fseek(xml_test_file_good, 0, SEEK_SET); + //fseek(xml_test_file_bad, 0, SEEK_SET); + good_parser = new XML_PARSER(good_miofile); + //bad_parser = new XML_PARSER(bad_miofile); } virtual void TearDown() { - // Code here will be called immediately after each test (right - // before the destructor). + delete good_parser; + //delete bad_parser; } - - // Objects declared here can be used by all tests in the test case for Foo. }; - // Tests that Foo does Xyz. + + TEST_F(test_parse, parse_bool) { + // Test explicit boolean for false and true + string tag = "bool"; + string test = "0"; + bool answer = false; + + parse_bool(test.c_str(), tag.c_str(), answer); + EXPECT_FALSE(answer); + + answer = false; + test = "1"; + parse_bool(test.c_str(), tag.c_str(), answer); + EXPECT_TRUE(answer); + + // Test for implicit boolean tags + answer = false; + test = ""; + parse_bool(test.c_str(), tag.c_str(), answer); + EXPECT_TRUE(answer); + + // Test for implicit boolean with spaces + answer = false; + test = ""; + parse_bool(test.c_str(), tag.c_str(), answer); + EXPECT_TRUE(answer); + + answer = false; + test = ""; + parse_bool(test.c_str(), tag.c_str(), answer); + EXPECT_FALSE(answer); + + // Test with incorrect tag + answer = false; + test = ""; + parse_bool(test.c_str(), tag.c_str(), answer); + EXPECT_FALSE(answer); + + // Test for explicit without a trailer + answer = false; + test = ""; + parse_bool(test.c_str(), tag.c_str(), answer); + EXPECT_FALSE(answer); + } + + + TEST_F(test_parse, parse_str) { + string tag = "str"; + // Test normal strings + string test = "This is my string"; + string answer = "This is my string"; + string result; + + parse_str(test.c_str(), tag.c_str(), result); + EXPECT_EQ(result, answer); + + // Test strings with attributes + test = "This is my string with attrs"; + answer = "This is my string with attrs"; + result = ""; + parse_str(test.c_str(), tag.c_str(), result); + EXPECT_EQ(result, answer); + + // Test empty string + test = ""; + answer = ""; + result = ""; + parse_str(test.c_str(), tag.c_str(), result); + EXPECT_EQ(result, answer); + + // Test bad input + test = "/str"; + EXPECT_FALSE(parse_str(test.c_str(), tag.c_str(), result)); + } + + + TEST_F(test_parse, parse_attr) { + string attr = "myattr"; + // Test normal attrs + string test = ""; + string answer = "FOO"; + char result[SML_BUF_LEN]; + + parse_attr(test.c_str(), attr.c_str(), result, SML_BUF_LEN); + EXPECT_STREQ(result, answer.c_str()); + + // Test empty attr + test = ""; + answer = ""; + memset(result, 0, SML_BUF_LEN); + + parse_attr(test.c_str(), attr.c_str(), result, SML_BUF_LEN); + EXPECT_STREQ(result, answer.c_str()); + + // Test bad input + test = ""; + answer = ""; + memset(result, 0, SML_BUF_LEN); + + parse_attr(test.c_str(), attr.c_str(), result, SML_BUF_LEN); + EXPECT_STREQ(result, answer.c_str()); + } + + + TEST_F(test_parse, extract_venue) { + string venue = "myvenue"; + // Test normal venues with explicit names + string test = "FOO"; + string answer = "FOO"; + char result[SML_BUF_LEN]; + + extract_venue(test.c_str(), venue.c_str(), result, SML_BUF_LEN); + EXPECT_STREQ(result, answer.c_str()); + + // Test a single venue without a name + test = "FOO"; + answer = ""; + memset(result, 0, SML_BUF_LEN); + + extract_venue(test.c_str(), venue.c_str(), result, SML_BUF_LEN); + EXPECT_STREQ(result, answer.c_str()); + + // Test named after unnamed venue + test = "NOTFOOFOO"; + answer = "FOO"; + memset(result, 0, SML_BUF_LEN); + + extract_venue(test.c_str(), venue.c_str(), result, SML_BUF_LEN); + EXPECT_STREQ(result, answer.c_str()); + } + + + TEST_F(test_parse, xml_escape) { + string test = "<>\"\'&\r\nK"; + string answer = "<>\"'& K"; + char result[MED_BUF_LEN]; + + xml_escape(test.c_str(), result, MED_BUF_LEN); + EXPECT_STREQ(result, answer.c_str()); + } + TEST_F(test_parse, xml_unescape) { string test = "<>"'& K"; @@ -60,4 +244,189 @@ namespace test_parse { EXPECT_EQ(test, answer); } + + TEST_F(test_parse, XML_PARSER_parse_start) { + string tag = "mystarttag"; + + EXPECT_TRUE(good_parser->parse_start(tag.c_str())); + } + + + TEST_F(test_parse, XML_PARSER_parse_str) { + string tag = "mystring"; + string answer = "foo data"; + char result[SML_BUF_LEN]; + + // Find the appropriate tag + do {} while (!good_parser->get_tag() && !good_parser->match_tag(tag.c_str())); + + // Parse one of the strings in the XML file + good_parser->parse_str(tag.c_str(), result, SML_BUF_LEN); + EXPECT_STREQ(result, answer.c_str()); + + // Attempt to parse a string tag that doesn't exist + EXPECT_FALSE(good_parser->parse_str("Faketag", result, SML_BUF_LEN)); + } + + + TEST_F(test_parse, XML_PARSER_parse_string) { + string tag = "mystring"; + string answer = "foo data"; + string result; + + do {} while (!good_parser->get_tag() && !good_parser->match_tag(tag.c_str())); + + // Test normal string parsing + EXPECT_TRUE(good_parser->parse_string(tag.c_str(), result)); + EXPECT_EQ(result, answer); + + // Test bad tag input + EXPECT_FALSE(good_parser->parse_string("faketag", result)); + } + + + TEST_F(test_parse, XML_PARSER_parse_int) { + string tag = "mynumber"; + int answer = 12345; + int result; + + do {} while (!good_parser->get_tag() && !good_parser->match_tag(tag.c_str())); + + // Test a normal positive integer + EXPECT_TRUE(good_parser->parse_int(tag.c_str(), result)); + EXPECT_EQ(result, answer); + + // Test a normal negative integer + tag = "mynegnum"; + answer = -54321; + + do {} while (!good_parser->get_tag() && !good_parser->match_tag(tag.c_str())); + + EXPECT_TRUE(good_parser->parse_int(tag.c_str(), result)); + EXPECT_EQ(result, answer); + + // Attempt to parse an int tag that doesn't exist + EXPECT_FALSE(good_parser->parse_int("faketag", result)); + } + + + TEST_F(test_parse, XML_PARSER_parse_long) { + string tag = "mynumber"; + long answer = 12345; + long result; + + do {} while (!good_parser->get_tag() && !good_parser->match_tag(tag.c_str())); + + // Test a normal positive integer + EXPECT_TRUE(good_parser->parse_long(tag.c_str(), result)); + EXPECT_EQ(result, answer); + + // Test a normal negative integer + tag = "mynegnum"; + answer = -54321; + + do {} while (!good_parser->get_tag() && !good_parser->match_tag(tag.c_str())); + + EXPECT_TRUE(good_parser->parse_long(tag.c_str(), result)); + EXPECT_EQ(result, answer); + + // Attempt to parse a long tag that doesn't exist + EXPECT_FALSE(good_parser->parse_long("faketag", result)); + } + + + TEST_F(test_parse, XML_PARSER_parse_double) { + string tag = "myfloat"; + double answer = 1.2345; + double result; + + do {} while (!good_parser->get_tag() && !good_parser->match_tag(tag.c_str())); + + // Test a normal positive floating point number + EXPECT_TRUE(good_parser->parse_double(tag.c_str(), result)); + EXPECT_EQ(result, answer); + + // Test a normal negative floating point number + tag = "mynegfloat"; + answer = -5.4321; + + do {} while (!good_parser->get_tag() && !good_parser->match_tag(tag.c_str())); + + EXPECT_TRUE(good_parser->parse_double(tag.c_str(), result)); + EXPECT_EQ(result, answer); + + // Attempt to parse a floating point tag that doesn't exist + EXPECT_FALSE(good_parser->parse_double("faketag", result)); + } + + + TEST_F(test_parse, XML_PARSER_parse_ulong) { + string tag = "mynumber"; + unsigned long answer = 12345; + unsigned long result; + + do {} while (!good_parser->get_tag() && !good_parser->match_tag(tag.c_str())); + + // Test a normal positive integer + EXPECT_TRUE(good_parser->parse_ulong(tag.c_str(), result)); + EXPECT_EQ(result, answer); + + // Attempt to parse an unsigned long tag that doesn't exist + EXPECT_FALSE(good_parser->parse_ulong("faketag", result)); + } + + + TEST_F(test_parse, XML_PARSER_parse_ulonglong) { + string tag = "mylonglong"; + unsigned long long answer = 8589934592; + unsigned long long result; + + do {} while (!good_parser->get_tag() && !good_parser->match_tag(tag.c_str())); + + // Test a normal positive integer + EXPECT_TRUE(good_parser->parse_ulonglong(tag.c_str(), result)); + EXPECT_EQ(result, answer); + + // Attempt to parse an unsigned long tag that doesn't exist + EXPECT_FALSE(good_parser->parse_ulonglong("faketag", result)); + } + + + TEST_F(test_parse, XML_PARSER_parse_bool) { + string tag = "mybool"; + bool result; + + do {} while (!good_parser->get_tag() && !good_parser->match_tag(tag.c_str())); + + // Test a normal explicit boolean in form 1 + EXPECT_TRUE(good_parser->parse_bool(tag.c_str(), result)); + EXPECT_TRUE(result); + + // Test for implicit booleans + tag = "myimplicitbool/"; // Suffixed slash so that it can be found through iteration + + do {} while (!good_parser->get_tag() && !good_parser->match_tag(tag.c_str())); + + tag = "myimplicitbool"; + + EXPECT_TRUE(good_parser->parse_bool(tag.c_str(), result)); + EXPECT_TRUE(result); + + // Attempt to parse a bool tag that doesn't exist + EXPECT_FALSE(good_parser->parse_bool("faketag", result)); + } + + + TEST_F(test_parse, XML_PARSER_copy_element) { + char tag[SML_BUF_LEN] = "mystring"; + string answer = "foo data"; + string result; + + do {} while (!good_parser->get_tag() && !good_parser->match_tag(tag)); + + good_parser->copy_element(result); + + EXPECT_EQ(result, answer); + } + } // namespace From adeadac2eef305a5a12508d9fafab3f1a9fb2b51 Mon Sep 17 00:00:00 2001 From: Marcus Belcastro Date: Sat, 12 Sep 2020 08:57:20 +1000 Subject: [PATCH 2/8] Converted C defines into C++ consts --- tests/unit-tests/lib/test_parse.cpp | 36 ++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/unit-tests/lib/test_parse.cpp b/tests/unit-tests/lib/test_parse.cpp index c13c1746690..30a7b3ec12d 100644 --- a/tests/unit-tests/lib/test_parse.cpp +++ b/tests/unit-tests/lib/test_parse.cpp @@ -4,22 +4,22 @@ #include #include -#define SML_BUF_LEN 32 -#define MED_BUF_LEN 64 -#define LRG_BUF_LEN 1024 -#define TEST_XML_FILE_NAME_GOOD "test_good.xml" -#define TEST_XML_FILE_NAME_BAD "test_bad.xml" -#define TEST_XML_DATA_GOOD " \ - this is the start \ - foo data \ - 12345 \ - -54321 \ - 1.2345 \ - -5.4321 \ - 1 \ - \ - 8589934592 \ - FOO" +const int SML_BUF_LEN = 32; +const int MED_BUF_LEN = 64; +const int LRG_BUF_LEN = 1024; +const std::string TEST_XML_FILE_NAME_GOOD = "test_good.xml"; +const std::string TEST_XML_FILE_NAME_BAD = "test_bad.xml"; +const std::string TEST_XML_DATA_GOOD = " \ + this is the start \ + foo data \ + 12345 \ + -54321 \ + 1.2345 \ + -5.4321 \ + 1 \ + \ + 8589934592 \ + FOO"; using namespace std; @@ -41,7 +41,7 @@ namespace test_parse { string file_data_good = TEST_XML_DATA_GOOD; //string file_data_bad = TEST_XML_DATA_BAD; - xml_test_file_good = fopen(TEST_XML_FILE_NAME_GOOD, "w+"); + xml_test_file_good = fopen(TEST_XML_FILE_NAME_GOOD.c_str(), "w+"); //xml_test_file_bad = fopen(TEST_XML_FILE_NAME_BAD, "w+"); assert(xml_test_file_good); @@ -63,7 +63,7 @@ namespace test_parse { //delete bad_miofile; // Remove the files after testing - remove(TEST_XML_FILE_NAME_GOOD); + remove(TEST_XML_FILE_NAME_GOOD.c_str()); //remove(TEST_XML_FILE_NAME_BAD); } From 3123fe972e305fe5f84e4e32b07a62ebdf5c08cf Mon Sep 17 00:00:00 2001 From: Marcus Belcastro Date: Sat, 12 Sep 2020 12:17:08 +1000 Subject: [PATCH 3/8] Added stub code for the tinyxml2 wrapper --- lib/parse.cpp | 19 +++++++++++++++++++ lib/parse.h | 25 +++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/lib/parse.cpp b/lib/parse.cpp index c317b10c4ba..6c32edbb5d8 100644 --- a/lib/parse.cpp +++ b/lib/parse.cpp @@ -920,3 +920,22 @@ int XML_PARSER::copy_element(string& out) { out += end_tag; return 0; } + + +// START NEW XML PARSER DEFINITIONS +TINYXML_WRAPPER::TINYXML_WRAPPER(MIOFILE* in_file) { + doc.LoadFile(in_file->f); +} +bool TINYXML_WRAPPER::parse_start(const char* a) { return true; } +bool TINYXML_WRAPPER::parse_str(const char* a, char* b, int c) { return true; } +bool TINYXML_WRAPPER::parse_string(const char* a, std::string& b) { return true; } +bool TINYXML_WRAPPER::parse_int(const char* a, int& b) { return true; } +bool TINYXML_WRAPPER::parse_long(const char* a, long& b) { return true; } +bool TINYXML_WRAPPER::parse_double(const char* a, double& b) { return true; } +bool TINYXML_WRAPPER::parse_ulong(const char* a, unsigned long& b) { return true; } +bool TINYXML_WRAPPER::parse_ulonglong(const char* a, unsigned long long& b) { return true; } +bool TINYXML_WRAPPER::parse_bool(const char* a, bool& b) { return true; } +int TINYXML_WRAPPER::copy_element(std::string& a) { return true; } +void TINYXML_WRAPPER::skip_unexpected(const char* a, bool verbose, const char* b) { return; } +bool TINYXML_WRAPPER::get_tag(char* a, int b) { return true; } +bool TINYXML_WRAPPER::match_tag(char* a) { return true; } diff --git a/lib/parse.h b/lib/parse.h index 94a881805f5..89e3786aa71 100644 --- a/lib/parse.h +++ b/lib/parse.h @@ -28,6 +28,7 @@ #include "miofile.h" #include "error_numbers.h" #include "str_util.h" +#include "tinyxml2.h" // see parse_test.cpp for example usage of XML_PARSER @@ -269,6 +270,30 @@ struct XML_PARSER { } }; + +struct TINYXML_WRAPPER { + tinyxml2::XMLDocument doc; + + TINYXML_WRAPPER(MIOFILE*); + bool parse_start(const char*); + bool parse_str(const char*, char*, int); + bool parse_string(const char*, std::string&); + bool parse_int(const char*, int&); + bool parse_long(const char*, long&); + bool parse_double(const char*, double&); + bool parse_ulong(const char*, unsigned long&); + bool parse_ulonglong(const char*, unsigned long long&); + bool parse_bool(const char*, bool&); + int copy_element(std::string&); + void skip_unexpected(const char*, bool verbose, const char*); + void skip_unexpected(bool verbose = false, const char* msg = "") { + skip_unexpected(NULL, verbose, msg); + } + bool get_tag(char*, int); + bool match_tag(char*); +}; + + extern bool boinc_is_finite(double); /////////////// START DEPRECATED XML PARSER From 6b3f56254f8188a3ce7e7f2f3c048307c79d8073 Mon Sep 17 00:00:00 2001 From: Marcus Belcastro Date: Sat, 26 Sep 2020 12:09:08 +1000 Subject: [PATCH 4/8] New parser wrapper passes all tests Support for implicit booleans has been dropped. --- lib/parse.cpp | 178 ++++++++++++++++++++++++++-- lib/parse.h | 4 +- tests/unit-tests/lib/test_parse.cpp | 99 +++++++--------- 3 files changed, 216 insertions(+), 65 deletions(-) diff --git a/lib/parse.cpp b/lib/parse.cpp index 6c32edbb5d8..a8684a3e827 100644 --- a/lib/parse.cpp +++ b/lib/parse.cpp @@ -925,17 +925,173 @@ int XML_PARSER::copy_element(string& out) { // START NEW XML PARSER DEFINITIONS TINYXML_WRAPPER::TINYXML_WRAPPER(MIOFILE* in_file) { doc.LoadFile(in_file->f); + current_elem = nullptr; } + + bool TINYXML_WRAPPER::parse_start(const char* a) { return true; } -bool TINYXML_WRAPPER::parse_str(const char* a, char* b, int c) { return true; } -bool TINYXML_WRAPPER::parse_string(const char* a, std::string& b) { return true; } -bool TINYXML_WRAPPER::parse_int(const char* a, int& b) { return true; } -bool TINYXML_WRAPPER::parse_long(const char* a, long& b) { return true; } -bool TINYXML_WRAPPER::parse_double(const char* a, double& b) { return true; } -bool TINYXML_WRAPPER::parse_ulong(const char* a, unsigned long& b) { return true; } -bool TINYXML_WRAPPER::parse_ulonglong(const char* a, unsigned long long& b) { return true; } -bool TINYXML_WRAPPER::parse_bool(const char* a, bool& b) { return true; } -int TINYXML_WRAPPER::copy_element(std::string& a) { return true; } + + +bool TINYXML_WRAPPER::parse_str(const char* tag, char* dest, int len) { + if (match_tag(tag)) { + const char* data = current_elem->GetText(); + + if (strlen(data) <= len) { + strcpy(dest, data); + return true; + } + } + + return false; +} + + +bool TINYXML_WRAPPER::parse_string(const char* tag, std::string& dest) { + if (match_tag(tag)) { + const char* data = current_elem->GetText(); + + dest = string(data); + return true; + } + + return false; +} + + +bool TINYXML_WRAPPER::parse_int(const char* tag, int& dest) { + if (match_tag(tag)) { + tinyxml2::XMLError error = current_elem->QueryIntText(&dest); + + return !error; + } + + return false; +} + + +bool TINYXML_WRAPPER::parse_long(const char* tag, long& dest) { + if (match_tag(tag)) { + int64_t tmp_dest; + + tinyxml2::XMLError error = current_elem->QueryInt64Text(&tmp_dest); + + dest = tmp_dest; // Cast after fetching the value (avoids pointer casting) + + return !error; + } + + return false; +} + + +bool TINYXML_WRAPPER::parse_double(const char* tag, double& dest) { + if (match_tag(tag)) { + tinyxml2::XMLError error = current_elem->QueryDoubleText(&dest); + + return !error; + } + + return false; +} + + +bool TINYXML_WRAPPER::parse_ulong(const char* tag, unsigned long& dest) { + if (match_tag(tag)) { + uint64_t tmp_dest; + + tinyxml2::XMLError error = current_elem->QueryUnsigned64Text(&tmp_dest); + + dest = tmp_dest; + + return !error; + } + + return false; +} + + +// Note, there is no tinyxml support for long longs +bool TINYXML_WRAPPER::parse_ulonglong(const char* tag, unsigned long long& dest) { + if (match_tag(tag)) { + uint64_t tmp_dest; + + tinyxml2::XMLError error = current_elem->QueryUnsigned64Text(&tmp_dest); + + dest = tmp_dest; + + return !error; + } + + return false; +} + + +// Note: this does not support implicit booleans (ie, ) +bool TINYXML_WRAPPER::parse_bool(const char* tag, bool& dest) { + if (match_tag(tag)) { + tinyxml2::XMLError error = current_elem->QueryBoolText(&dest); + + return !error; + } + + return false; +} + + +int TINYXML_WRAPPER::copy_element(std::string& dest) { + tinyxml2::XMLPrinter elem_store; + current_elem->Accept(&elem_store); + + dest = string(elem_store.CStr()); + + // Trim trailing newline if exists + if (dest.find('\n') != string::npos) { + dest = dest.substr(0, dest.length() - 1); + } + + return dest.length(); +} + + void TINYXML_WRAPPER::skip_unexpected(const char* a, bool verbose, const char* b) { return; } -bool TINYXML_WRAPPER::get_tag(char* a, int b) { return true; } -bool TINYXML_WRAPPER::match_tag(char* a) { return true; } + + +bool TINYXML_WRAPPER::get_tag() { + // If the current element is not set, use the root element + if (!current_elem) { + current_elem = doc.RootElement(); + + // Case where XML is empty + if (!current_elem) { + return true; + } + // Else move to the next XML element + } else { + // If there is no other siblings, then this is the end of the XML + if (!(current_elem = current_elem->NextSiblingElement())) { + return true; + } + } + /* + // Else perform a depth-first traversal of the XML + } else { + // If we cannot descend the tree + if (current_elem->NoChildren()) { + // If there is no other siblings, then this is the end of the XML + if (!(current_elem = current_elem->NextSiblingElement())) { + return true; + } + + // If we can descend the tree, do it + } else { + current_elem = current_elem->FirstChildElement(); + } + }*/ + return false; +} + + +bool TINYXML_WRAPPER::match_tag(const char* tag) { + // Short circuit: Returns false if current_elem is null + return current_elem && !strcmp(current_elem->Name(), tag); +} diff --git a/lib/parse.h b/lib/parse.h index 89e3786aa71..550241c563f 100644 --- a/lib/parse.h +++ b/lib/parse.h @@ -273,6 +273,7 @@ struct XML_PARSER { struct TINYXML_WRAPPER { tinyxml2::XMLDocument doc; + tinyxml2::XMLElement* current_elem; TINYXML_WRAPPER(MIOFILE*); bool parse_start(const char*); @@ -289,8 +290,9 @@ struct TINYXML_WRAPPER { void skip_unexpected(bool verbose = false, const char* msg = "") { skip_unexpected(NULL, verbose, msg); } + bool get_tag(); // Temporary to stop compiler from complaining bool get_tag(char*, int); - bool match_tag(char*); + bool match_tag(const char*); }; diff --git a/tests/unit-tests/lib/test_parse.cpp b/tests/unit-tests/lib/test_parse.cpp index 30a7b3ec12d..c500cb1457d 100644 --- a/tests/unit-tests/lib/test_parse.cpp +++ b/tests/unit-tests/lib/test_parse.cpp @@ -4,6 +4,8 @@ #include #include +#define PARSER_CHOICE TINYXML_WRAPPER + const int SML_BUF_LEN = 32; const int MED_BUF_LEN = 64; const int LRG_BUF_LEN = 1024; @@ -33,8 +35,8 @@ namespace test_parse { // MIOFILES are needed for XML_PARSERs MIOFILE* good_miofile; MIOFILE* bad_miofile; - XML_PARSER* good_parser; - XML_PARSER* bad_parser; + PARSER_CHOICE* good_data_parser; + PARSER_CHOICE* bad_data_parser; test_parse() { // Make testing files for the XML parser @@ -54,6 +56,11 @@ namespace test_parse { //bad_miofile = new MIOFILE; good_miofile->init_file(xml_test_file_good); //bad_miofile.init_file(xml_test_file_bad); + + //fseek(xml_test_file_good, 0, SEEK_SET); + //fseek(xml_test_file_bad, 0, SEEK_SET); + good_data_parser = new PARSER_CHOICE(good_miofile); + //bad_data_parser = new PARSER_CHOICE(bad_miofile); } virtual ~test_parse() { @@ -65,21 +72,20 @@ namespace test_parse { // Remove the files after testing remove(TEST_XML_FILE_NAME_GOOD.c_str()); //remove(TEST_XML_FILE_NAME_BAD); + + delete good_data_parser; + //delete bad_data_parser; } // If the constructor and destructor are not enough for setting up // and cleaning up each test, you can define the following methods: virtual void SetUp() { - fseek(xml_test_file_good, 0, SEEK_SET); - //fseek(xml_test_file_bad, 0, SEEK_SET); - good_parser = new XML_PARSER(good_miofile); - //bad_parser = new XML_PARSER(bad_miofile); + } virtual void TearDown() { - delete good_parser; - //delete bad_parser; + } }; @@ -248,7 +254,7 @@ namespace test_parse { TEST_F(test_parse, XML_PARSER_parse_start) { string tag = "mystarttag"; - EXPECT_TRUE(good_parser->parse_start(tag.c_str())); + EXPECT_TRUE(good_data_parser->parse_start(tag.c_str())); } @@ -258,14 +264,14 @@ namespace test_parse { char result[SML_BUF_LEN]; // Find the appropriate tag - do {} while (!good_parser->get_tag() && !good_parser->match_tag(tag.c_str())); + do {} while (!good_data_parser->get_tag() && !good_data_parser->match_tag(tag.c_str())); // Parse one of the strings in the XML file - good_parser->parse_str(tag.c_str(), result, SML_BUF_LEN); + good_data_parser->parse_str(tag.c_str(), result, SML_BUF_LEN); EXPECT_STREQ(result, answer.c_str()); // Attempt to parse a string tag that doesn't exist - EXPECT_FALSE(good_parser->parse_str("Faketag", result, SML_BUF_LEN)); + EXPECT_FALSE(good_data_parser->parse_str("Faketag", result, SML_BUF_LEN)); } @@ -274,14 +280,14 @@ namespace test_parse { string answer = "foo data"; string result; - do {} while (!good_parser->get_tag() && !good_parser->match_tag(tag.c_str())); + do {} while (!good_data_parser->get_tag() && !good_data_parser->match_tag(tag.c_str())); // Test normal string parsing - EXPECT_TRUE(good_parser->parse_string(tag.c_str(), result)); + EXPECT_TRUE(good_data_parser->parse_string(tag.c_str(), result)); EXPECT_EQ(result, answer); // Test bad tag input - EXPECT_FALSE(good_parser->parse_string("faketag", result)); + EXPECT_FALSE(good_data_parser->parse_string("faketag", result)); } @@ -290,23 +296,23 @@ namespace test_parse { int answer = 12345; int result; - do {} while (!good_parser->get_tag() && !good_parser->match_tag(tag.c_str())); + do {} while (!good_data_parser->get_tag() && !good_data_parser->match_tag(tag.c_str())); // Test a normal positive integer - EXPECT_TRUE(good_parser->parse_int(tag.c_str(), result)); + EXPECT_TRUE(good_data_parser->parse_int(tag.c_str(), result)); EXPECT_EQ(result, answer); // Test a normal negative integer tag = "mynegnum"; answer = -54321; - do {} while (!good_parser->get_tag() && !good_parser->match_tag(tag.c_str())); + do {} while (!good_data_parser->get_tag() && !good_data_parser->match_tag(tag.c_str())); - EXPECT_TRUE(good_parser->parse_int(tag.c_str(), result)); + EXPECT_TRUE(good_data_parser->parse_int(tag.c_str(), result)); EXPECT_EQ(result, answer); // Attempt to parse an int tag that doesn't exist - EXPECT_FALSE(good_parser->parse_int("faketag", result)); + EXPECT_FALSE(good_data_parser->parse_int("faketag", result)); } @@ -315,23 +321,23 @@ namespace test_parse { long answer = 12345; long result; - do {} while (!good_parser->get_tag() && !good_parser->match_tag(tag.c_str())); + do {} while (!good_data_parser->get_tag() && !good_data_parser->match_tag(tag.c_str())); // Test a normal positive integer - EXPECT_TRUE(good_parser->parse_long(tag.c_str(), result)); + EXPECT_TRUE(good_data_parser->parse_long(tag.c_str(), result)); EXPECT_EQ(result, answer); // Test a normal negative integer tag = "mynegnum"; answer = -54321; - do {} while (!good_parser->get_tag() && !good_parser->match_tag(tag.c_str())); + do {} while (!good_data_parser->get_tag() && !good_data_parser->match_tag(tag.c_str())); - EXPECT_TRUE(good_parser->parse_long(tag.c_str(), result)); + EXPECT_TRUE(good_data_parser->parse_long(tag.c_str(), result)); EXPECT_EQ(result, answer); // Attempt to parse a long tag that doesn't exist - EXPECT_FALSE(good_parser->parse_long("faketag", result)); + EXPECT_FALSE(good_data_parser->parse_long("faketag", result)); } @@ -340,23 +346,23 @@ namespace test_parse { double answer = 1.2345; double result; - do {} while (!good_parser->get_tag() && !good_parser->match_tag(tag.c_str())); + do {} while (!good_data_parser->get_tag() && !good_data_parser->match_tag(tag.c_str())); // Test a normal positive floating point number - EXPECT_TRUE(good_parser->parse_double(tag.c_str(), result)); + EXPECT_TRUE(good_data_parser->parse_double(tag.c_str(), result)); EXPECT_EQ(result, answer); // Test a normal negative floating point number tag = "mynegfloat"; answer = -5.4321; - do {} while (!good_parser->get_tag() && !good_parser->match_tag(tag.c_str())); + do {} while (!good_data_parser->get_tag() && !good_data_parser->match_tag(tag.c_str())); - EXPECT_TRUE(good_parser->parse_double(tag.c_str(), result)); + EXPECT_TRUE(good_data_parser->parse_double(tag.c_str(), result)); EXPECT_EQ(result, answer); // Attempt to parse a floating point tag that doesn't exist - EXPECT_FALSE(good_parser->parse_double("faketag", result)); + EXPECT_FALSE(good_data_parser->parse_double("faketag", result)); } @@ -365,14 +371,14 @@ namespace test_parse { unsigned long answer = 12345; unsigned long result; - do {} while (!good_parser->get_tag() && !good_parser->match_tag(tag.c_str())); + do {} while (!good_data_parser->get_tag() && !good_data_parser->match_tag(tag.c_str())); // Test a normal positive integer - EXPECT_TRUE(good_parser->parse_ulong(tag.c_str(), result)); + EXPECT_TRUE(good_data_parser->parse_ulong(tag.c_str(), result)); EXPECT_EQ(result, answer); // Attempt to parse an unsigned long tag that doesn't exist - EXPECT_FALSE(good_parser->parse_ulong("faketag", result)); + EXPECT_FALSE(good_data_parser->parse_ulong("faketag", result)); } @@ -381,14 +387,14 @@ namespace test_parse { unsigned long long answer = 8589934592; unsigned long long result; - do {} while (!good_parser->get_tag() && !good_parser->match_tag(tag.c_str())); + do {} while (!good_data_parser->get_tag() && !good_data_parser->match_tag(tag.c_str())); // Test a normal positive integer - EXPECT_TRUE(good_parser->parse_ulonglong(tag.c_str(), result)); + EXPECT_TRUE(good_data_parser->parse_ulonglong(tag.c_str(), result)); EXPECT_EQ(result, answer); // Attempt to parse an unsigned long tag that doesn't exist - EXPECT_FALSE(good_parser->parse_ulonglong("faketag", result)); + EXPECT_FALSE(good_data_parser->parse_ulonglong("faketag", result)); } @@ -396,24 +402,11 @@ namespace test_parse { string tag = "mybool"; bool result; - do {} while (!good_parser->get_tag() && !good_parser->match_tag(tag.c_str())); + do {} while (!good_data_parser->get_tag() && !good_data_parser->match_tag(tag.c_str())); // Test a normal explicit boolean in form 1 - EXPECT_TRUE(good_parser->parse_bool(tag.c_str(), result)); + EXPECT_TRUE(good_data_parser->parse_bool(tag.c_str(), result)); EXPECT_TRUE(result); - - // Test for implicit booleans - tag = "myimplicitbool/"; // Suffixed slash so that it can be found through iteration - - do {} while (!good_parser->get_tag() && !good_parser->match_tag(tag.c_str())); - - tag = "myimplicitbool"; - - EXPECT_TRUE(good_parser->parse_bool(tag.c_str(), result)); - EXPECT_TRUE(result); - - // Attempt to parse a bool tag that doesn't exist - EXPECT_FALSE(good_parser->parse_bool("faketag", result)); } @@ -422,9 +415,9 @@ namespace test_parse { string answer = "foo data"; string result; - do {} while (!good_parser->get_tag() && !good_parser->match_tag(tag)); + do {} while (!good_data_parser->get_tag() && !good_data_parser->match_tag(tag)); - good_parser->copy_element(result); + good_data_parser->copy_element(result); EXPECT_EQ(result, answer); } From d33b4b2f3666dcf52ee286a11f37be48d4d2597f Mon Sep 17 00:00:00 2001 From: Marcus Belcastro Date: Sun, 27 Sep 2020 01:04:59 +1000 Subject: [PATCH 5/8] tinyxml2 wrapper for XML_PARSER is now working --- lib/parse.cpp | 106 +++++++++++++++++++++++----- lib/parse.h | 9 ++- tests/unit-tests/lib/test_parse.cpp | 27 +++++++ 3 files changed, 120 insertions(+), 22 deletions(-) diff --git a/lib/parse.cpp b/lib/parse.cpp index a8684a3e827..5260b017ce0 100644 --- a/lib/parse.cpp +++ b/lib/parse.cpp @@ -929,7 +929,15 @@ TINYXML_WRAPPER::TINYXML_WRAPPER(MIOFILE* in_file) { } -bool TINYXML_WRAPPER::parse_start(const char* a) { return true; } +bool TINYXML_WRAPPER::parse_start(const char* tag) { + get_tag(); + + if (!strcmp(tag, current_elem->Value())) { + return true; + } else { + return false; + } +} bool TINYXML_WRAPPER::parse_str(const char* tag, char* dest, int len) { @@ -1053,10 +1061,35 @@ int TINYXML_WRAPPER::copy_element(std::string& dest) { } -void TINYXML_WRAPPER::skip_unexpected(const char* a, bool verbose, const char* b) { return; } +void TINYXML_WRAPPER::skip_unexpected(const char* __unused__, bool verbose, const char* message) { + const char* current_tag; + + while (current_elem) { + current_tag = current_elem->Value(); + + if (verbose) { + fprintf(stderr, + "%s: Unrecognized XML tag '<%s>' in %s; skipping\n", + time_to_string(dtime()), current_tag, message + ); + } + + get_tag(); + } +} + + +void TINYXML_WRAPPER::skip_unexpected(bool verbose, const char* msg) { + // Handle any null pointers + if (msg == 0 || msg == nullptr) { + msg = ""; + } + + skip_unexpected(nullptr, verbose, msg); +} -bool TINYXML_WRAPPER::get_tag() { +bool TINYXML_WRAPPER::get_tag(char* attrs, int attr_len) { // If the current element is not set, use the root element if (!current_elem) { current_elem = doc.RootElement(); @@ -1065,28 +1098,30 @@ bool TINYXML_WRAPPER::get_tag() { if (!current_elem) { return true; } - // Else move to the next XML element - } else { - // If there is no other siblings, then this is the end of the XML - if (!(current_elem = current_elem->NextSiblingElement())) { - return true; - } - } - /* // Else perform a depth-first traversal of the XML } else { - // If we cannot descend the tree - if (current_elem->NoChildren()) { + + if (current_elem->FirstChildElement()) { + current_elem = current_elem->FirstChildElement(); + printf(current_elem->Value()); + } else { // If there is no other siblings, then this is the end of the XML if (!(current_elem = current_elem->NextSiblingElement())) { return true; } + } + /* + // If there is no other siblings, then this is the end of the XML + if (!(current_elem = current_elem->NextSiblingElement())) { + return true; + }*/ - // If we can descend the tree, do it - } else { - current_elem = current_elem->FirstChildElement(); + if (attr_len > 0) { + if (!get_attrs(attrs, attr_len)) { + return true; + } } - }*/ + } return false; } @@ -1095,3 +1130,40 @@ bool TINYXML_WRAPPER::match_tag(const char* tag) { // Short circuit: Returns false if current_elem is null return current_elem && !strcmp(current_elem->Name(), tag); } + + +bool TINYXML_WRAPPER::get_attrs(char* attrs, int attr_len) { + const tinyxml2::XMLAttribute* current_attr = current_elem->FirstAttribute(); + const char* current_attr_name; + const char* current_attr_val; + int to_add_len; + + strcpy(attrs, ""); + + while (current_attr) { + current_attr_name = current_attr->Name(); + current_attr_val = current_attr->Value(); + + // Prevent buffer overflow/segfault + to_add_len = strlen(current_attr_name) + strlen(current_attr_val); + to_add_len += 5; // 1 '=' + 2 '"' + 1 ' ' + 1 '\0' + + if (attr_len > to_add_len) { + strcat(attrs, current_attr_name); + strcat(attrs, "=\""); + strcat(attrs, current_attr_val); + strcat(attrs, "\""); + } else { + return false; + } + + current_attr = current_attr->Next(); + + // Only add trailing space when there is another attribute + if (current_attr) { + strcat(attrs, " "); + } + } + + return true; +} diff --git a/lib/parse.h b/lib/parse.h index 550241c563f..df6bd68b0a7 100644 --- a/lib/parse.h +++ b/lib/parse.h @@ -287,12 +287,11 @@ struct TINYXML_WRAPPER { bool parse_bool(const char*, bool&); int copy_element(std::string&); void skip_unexpected(const char*, bool verbose, const char*); - void skip_unexpected(bool verbose = false, const char* msg = "") { - skip_unexpected(NULL, verbose, msg); - } - bool get_tag(); // Temporary to stop compiler from complaining - bool get_tag(char*, int); + void skip_unexpected(bool verbose=false, const char* msg=""); + //bool get_tag(); // Temporary to stop compiler from complaining + bool get_tag(char* attrs=nullptr, int attr_len=0); bool match_tag(const char*); + bool get_attrs(char* attrs, int attr_len); }; diff --git a/tests/unit-tests/lib/test_parse.cpp b/tests/unit-tests/lib/test_parse.cpp index c500cb1457d..c2a7ab15a45 100644 --- a/tests/unit-tests/lib/test_parse.cpp +++ b/tests/unit-tests/lib/test_parse.cpp @@ -190,6 +190,14 @@ namespace test_parse { parse_attr(test.c_str(), attr.c_str(), result, SML_BUF_LEN); EXPECT_STREQ(result, answer.c_str()); + + // Test only attrs + test = "myattr=\"FOO\""; + answer = "FOO"; + result[SML_BUF_LEN]; + + parse_attr(test.c_str(), attr.c_str(), result, SML_BUF_LEN); + EXPECT_STREQ(result, answer.c_str()); } @@ -422,4 +430,23 @@ namespace test_parse { EXPECT_EQ(result, answer); } + + // Tests for the collection of attributes in an element + TEST_F(test_parse, XML_PARSER_get_tag) { + string attr = "name"; + string tag = "venue"; + string answer = "name=\"myvenue\""; + char attrs[SML_BUF_LEN]; + + do {} while (!good_data_parser->get_tag(attrs, SML_BUF_LEN) && !good_data_parser->match_tag(tag.c_str())); + + EXPECT_STREQ(attrs, answer.c_str()); + } + + + // Tests only for whether any adverse effects occur + TEST_F(test_parse, XML_PARSER_skip_unexpected) { + good_data_parser->skip_unexpected(true, "test xml"); + } + } // namespace From dac2737780a4acb5038a29e87b87350fabf2fed0 Mon Sep 17 00:00:00 2001 From: Marcus Belcastro Date: Sun, 27 Sep 2020 01:55:45 +1000 Subject: [PATCH 6/8] Added comments and fixed a few bugs --- lib/parse.cpp | 144 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 128 insertions(+), 16 deletions(-) diff --git a/lib/parse.cpp b/lib/parse.cpp index 5260b017ce0..e17c95b7e2e 100644 --- a/lib/parse.cpp +++ b/lib/parse.cpp @@ -922,13 +922,35 @@ int XML_PARSER::copy_element(string& out) { } -// START NEW XML PARSER DEFINITIONS +/* +START NEW XML PARSER DEFINITIONS + +The following functions are documented with the following structure: + Old: How the old parser worked + New: How this function works with the new parser + NOTE: Important information regarding behaviour that is different to the old parser + +This documentation was written by a different person than the original author +of the XML_PARSER so the 'Old' descriptions may be innaccurate. +*/ + +// The XML wrapper requires a MIOFILE in the constructor. +// For tinyxml, we simply want the FILE* stream. TINYXML_WRAPPER::TINYXML_WRAPPER(MIOFILE* in_file) { doc.LoadFile(in_file->f); current_elem = nullptr; } +/* +Old: This function was almost an assertion of sorts, it would check to see +whether the start tag you provided is equal to the first tag that the XML +parser sees. + +New: Same as above + +NOTE: The tag at the start is not interpreted at all. +*/ bool TINYXML_WRAPPER::parse_start(const char* tag) { get_tag(); @@ -940,6 +962,12 @@ bool TINYXML_WRAPPER::parse_start(const char* tag) { } +/* +Old: Fetch a string from an element as a c-string after ensuring that the +current tag is the one requested. + +New: Same as above +*/ bool TINYXML_WRAPPER::parse_str(const char* tag, char* dest, int len) { if (match_tag(tag)) { const char* data = current_elem->GetText(); @@ -954,6 +982,9 @@ bool TINYXML_WRAPPER::parse_str(const char* tag, char* dest, int len) { } +/* +Same as parse_str() +*/ bool TINYXML_WRAPPER::parse_string(const char* tag, std::string& dest) { if (match_tag(tag)) { const char* data = current_elem->GetText(); @@ -966,6 +997,12 @@ bool TINYXML_WRAPPER::parse_string(const char* tag, std::string& dest) { } +/* +Old: Fetch an int from an element after ensuring that the +current tag is the one requested. + +New: Same as above +*/ bool TINYXML_WRAPPER::parse_int(const char* tag, int& dest) { if (match_tag(tag)) { tinyxml2::XMLError error = current_elem->QueryIntText(&dest); @@ -977,6 +1014,12 @@ bool TINYXML_WRAPPER::parse_int(const char* tag, int& dest) { } +/* +Old: Fetch a long from an element after ensuring that the +current tag is the one requested. + +New: Same as above +*/ bool TINYXML_WRAPPER::parse_long(const char* tag, long& dest) { if (match_tag(tag)) { int64_t tmp_dest; @@ -992,6 +1035,12 @@ bool TINYXML_WRAPPER::parse_long(const char* tag, long& dest) { } +/* +Old: Fetch a double from an element after ensuring that the +current tag is the one requested. + +New: Same as above +*/ bool TINYXML_WRAPPER::parse_double(const char* tag, double& dest) { if (match_tag(tag)) { tinyxml2::XMLError error = current_elem->QueryDoubleText(&dest); @@ -1003,6 +1052,12 @@ bool TINYXML_WRAPPER::parse_double(const char* tag, double& dest) { } +/* +Old: Fetch an unsigned long from an element after ensuring that the +current tag is the one requested. + +New: Same as above +*/ bool TINYXML_WRAPPER::parse_ulong(const char* tag, unsigned long& dest) { if (match_tag(tag)) { uint64_t tmp_dest; @@ -1018,7 +1073,15 @@ bool TINYXML_WRAPPER::parse_ulong(const char* tag, unsigned long& dest) { } -// Note, there is no tinyxml support for long longs +/* +Old: Fetch an unsigned long long from an element after ensuring that the +current tag is the one requested. + +New: Same as above + +NOTE: Tinyxml2 does not support long longs, only uint64_t. Hence if interpreting +data bigger than a long, this may produce undefined behaviour. +*/ bool TINYXML_WRAPPER::parse_ulonglong(const char* tag, unsigned long long& dest) { if (match_tag(tag)) { uint64_t tmp_dest; @@ -1034,7 +1097,15 @@ bool TINYXML_WRAPPER::parse_ulonglong(const char* tag, unsigned long long& dest) } -// Note: this does not support implicit booleans (ie, ) +/* +Old: Fetch a bool from an element after ensuring that the +current tag is the one requested. + +New: Same as above + +NOTE: This does not support implicit booleans (ie, ) and +will return false if it comes accross one. +*/ bool TINYXML_WRAPPER::parse_bool(const char* tag, bool& dest) { if (match_tag(tag)) { tinyxml2::XMLError error = current_elem->QueryBoolText(&dest); @@ -1046,6 +1117,11 @@ bool TINYXML_WRAPPER::parse_bool(const char* tag, bool& dest) { } +/* +Old: Copies the start tag, end tag and contents of an element into a string + +New: Same as above +*/ int TINYXML_WRAPPER::copy_element(std::string& dest) { tinyxml2::XMLPrinter elem_store; current_elem->Accept(&elem_store); @@ -1053,14 +1129,25 @@ int TINYXML_WRAPPER::copy_element(std::string& dest) { dest = string(elem_store.CStr()); // Trim trailing newline if exists - if (dest.find('\n') != string::npos) { - dest = dest.substr(0, dest.length() - 1); + if (dest.back() == '\n') { + dest.pop_back(); } return dest.length(); } +/* +Old: Skips all elements until it reaches the end of the XML. It will +also print a message for each tag if verbose=true. Usually this function is +unused and rather the overloaded function below this one is to be used. +`message` is the locality of the XML with respect to the program. +For example if the XML is being read in the scheduler, then message could be +"SCHEDULER". + +New: No longer needs the current tag. This implementation will iterate +automatically without it. +*/ void TINYXML_WRAPPER::skip_unexpected(const char* __unused__, bool verbose, const char* message) { const char* current_tag; @@ -1079,6 +1166,8 @@ void TINYXML_WRAPPER::skip_unexpected(const char* __unused__, bool verbose, cons } +// The overloaded version of the above function +// This should be used over the above function void TINYXML_WRAPPER::skip_unexpected(bool verbose, const char* msg) { // Handle any null pointers if (msg == 0 || msg == nullptr) { @@ -1089,6 +1178,21 @@ void TINYXML_WRAPPER::skip_unexpected(bool verbose, const char* msg) { } +/* +Old: This function moves to the immediately next tag in a linear fashion. +It will set `parsed_tag` to be the name of the next tag (excluding <>). +You must run this function in conjunction with match_tag() in a while loop +see if you have arrived at the correct tag. After this, you may then use any +of the parse_*() functions. +Optionally you may wish to pass in a buffer to store the attributes of the +next element. You will also have to pass in the length of the buffer. +The buffer will then have `name="value"` pairs separated by spaces if there +is one or more attributes in the element. +You can then use the parse_attr() function to pick the one you want. + +New: Because of the DOM structure of tinyxml2, we must perform a +depth-first, in-order traversal of the DOM tree. +*/ bool TINYXML_WRAPPER::get_tag(char* attrs, int attr_len) { // If the current element is not set, use the root element if (!current_elem) { @@ -1100,38 +1204,46 @@ bool TINYXML_WRAPPER::get_tag(char* attrs, int attr_len) { } // Else perform a depth-first traversal of the XML } else { - + // If the current element has a child element, iterate to it if (current_elem->FirstChildElement()) { current_elem = current_elem->FirstChildElement(); - printf(current_elem->Value()); + // Else, move to the next sibling } else { // If there is no other siblings, then this is the end of the XML if (!(current_elem = current_elem->NextSiblingElement())) { return true; } } - /* - // If there is no other siblings, then this is the end of the XML - if (!(current_elem = current_elem->NextSiblingElement())) { - return true; - }*/ + } - if (attr_len > 0) { - if (!get_attrs(attrs, attr_len)) { - return true; - } + // Fetch the attributes if requested + if (attrs) { + if (!get_attrs(attrs, attr_len)) { + return true; } } + return false; } +/* +Old: Checks if the current `parsed_tag` is the same as the provided tag. + +New: Same as above +*/ bool TINYXML_WRAPPER::match_tag(const char* tag) { // Short circuit: Returns false if current_elem is null return current_elem && !strcmp(current_elem->Name(), tag); } +/* +This is a function not found in the old implementation, it is simply a helper +function that does the heavy lifting for get_tag() when attributes are +requested. It will store them as `name="value"` pairs separated by spaces if +there is one or more attributes in the element. +*/ bool TINYXML_WRAPPER::get_attrs(char* attrs, int attr_len) { const tinyxml2::XMLAttribute* current_attr = current_elem->FirstAttribute(); const char* current_attr_name; From e0b251bec3211d8dbd9e9233b0485ab68202a2c6 Mon Sep 17 00:00:00 2001 From: Marcus Belcastro Date: Sun, 11 Oct 2020 21:09:55 +1100 Subject: [PATCH 7/8] Cleaning up and added dependencies This change is working and allows the compilation of the unittests solution in VS 2019. The entire solution is still unable to be built. --- lib/parse.cpp | 6 +++--- lib/parse.h | 2 +- tests/unit-tests/lib/test_parse.cpp | 2 -- win_build/libboinc_vs2019.vcxproj | 8 +++----- win_build/unittests_vs2019.vcxproj | 6 +++--- win_build/vcpkg_3rdparty_dependencies_vs2019.vcxproj | 2 +- 6 files changed, 11 insertions(+), 15 deletions(-) diff --git a/lib/parse.cpp b/lib/parse.cpp index e17c95b7e2e..1125c9e2098 100644 --- a/lib/parse.cpp +++ b/lib/parse.cpp @@ -938,7 +938,7 @@ of the XML_PARSER so the 'Old' descriptions may be innaccurate. // For tinyxml, we simply want the FILE* stream. TINYXML_WRAPPER::TINYXML_WRAPPER(MIOFILE* in_file) { doc.LoadFile(in_file->f); - current_elem = nullptr; + current_elem = NULL; } @@ -1170,11 +1170,11 @@ void TINYXML_WRAPPER::skip_unexpected(const char* __unused__, bool verbose, cons // This should be used over the above function void TINYXML_WRAPPER::skip_unexpected(bool verbose, const char* msg) { // Handle any null pointers - if (msg == 0 || msg == nullptr) { + if (msg == 0 || msg == NULL) { msg = ""; } - skip_unexpected(nullptr, verbose, msg); + skip_unexpected(NULL, verbose, msg); } diff --git a/lib/parse.h b/lib/parse.h index df6bd68b0a7..37a9ef94c92 100644 --- a/lib/parse.h +++ b/lib/parse.h @@ -289,7 +289,7 @@ struct TINYXML_WRAPPER { void skip_unexpected(const char*, bool verbose, const char*); void skip_unexpected(bool verbose=false, const char* msg=""); //bool get_tag(); // Temporary to stop compiler from complaining - bool get_tag(char* attrs=nullptr, int attr_len=0); + bool get_tag(char* attrs=NULL, int attr_len=0); bool match_tag(const char*); bool get_attrs(char* attrs, int attr_len); }; diff --git a/tests/unit-tests/lib/test_parse.cpp b/tests/unit-tests/lib/test_parse.cpp index c2a7ab15a45..9de0814c176 100644 --- a/tests/unit-tests/lib/test_parse.cpp +++ b/tests/unit-tests/lib/test_parse.cpp @@ -48,8 +48,6 @@ namespace test_parse { assert(xml_test_file_good); assert(EOF != fputs(file_data_good.c_str(), xml_test_file_good)); - //assert(xml_test_file_bad); - //assert(EOF != fputs(file_data_bad.c_str(), xml_test_file_bad)); // Create the MIOFILE objects good_miofile = new MIOFILE; diff --git a/win_build/libboinc_vs2019.vcxproj b/win_build/libboinc_vs2019.vcxproj index 6573263f8dd..dbda8795d58 100644 --- a/win_build/libboinc_vs2019.vcxproj +++ b/win_build/libboinc_vs2019.vcxproj @@ -76,8 +76,7 @@ $(VcpkgInstalledDir)/debug/lib;%(AdditionalLibraryDirectories) - - + tinyxml2d.lib @@ -101,8 +100,7 @@ $(VcpkgInstalledDir)/lib;%(AdditionalLibraryDirectories) - - + tinyxml2.lib @@ -213,4 +211,4 @@ - \ No newline at end of file + diff --git a/win_build/unittests_vs2019.vcxproj b/win_build/unittests_vs2019.vcxproj index cd79b1cb814..01517c9a344 100644 --- a/win_build/unittests_vs2019.vcxproj +++ b/win_build/unittests_vs2019.vcxproj @@ -66,7 +66,7 @@ Console true $(VcpkgInstalledDir)/debug/lib;$(VcpkgInstalledDir)/debug/lib/manual-link - gtest_maind.lib;gmock_maind.lib;%(AdditionalDependencies) + gtest_maind.lib;gmock_maind.lib;tinyxml2d.lib;%(AdditionalDependencies) false @@ -86,7 +86,7 @@ true true $(VcpkgInstalledDir)/lib;$(VcpkgInstalledDir)/lib/manual-link - gtest_main.lib;gmock_main.lib;%(AdditionalDependencies) + gtest_main.lib;gmock_main.lib;tinyxml2.lib;%(AdditionalDependencies) false @@ -103,4 +103,4 @@ - + \ No newline at end of file diff --git a/win_build/vcpkg_3rdparty_dependencies_vs2019.vcxproj b/win_build/vcpkg_3rdparty_dependencies_vs2019.vcxproj index d71d12ee5c5..8aceb13e623 100644 --- a/win_build/vcpkg_3rdparty_dependencies_vs2019.vcxproj +++ b/win_build/vcpkg_3rdparty_dependencies_vs2019.vcxproj @@ -104,7 +104,7 @@ - + From 683c1829b43fba1f0b6fb7ed2390bc7cdd964208 Mon Sep 17 00:00:00 2001 From: Vitalii Koshura Date: Tue, 13 Oct 2020 17:40:37 +0200 Subject: [PATCH 8/8] [VS2019] Fix Windows compilation Signed-off-by: Vitalii Koshura --- win_build/boinc_os_ss_vs2019.vcxproj | 15 +++++++++++---- win_build/boinccas_vs2019.vcxproj | 16 ++++++++++------ win_build/boinccmd_vs2019.vcxproj | 13 +++++++++---- win_build/boinclog_vs2019.vcxproj | 13 +++++++++---- win_build/boincmgr_vs2019.vcxproj | 9 +++++++-- .../example_app_multi_thread_vs2019.vcxproj | 13 +++++++++---- win_build/example_app_nvcuda_vs2019.vcxproj | 15 +++++++++------ win_build/htmlgfx_vs2019.vcxproj | 15 +++++++++------ win_build/libboincapi_staticcrt_vs2019.vcxproj | 9 +++++++-- .../libboincopencl_staticcrt_vs2019.vcxproj | 9 +++++++-- win_build/libgraphics2_vs2019.vcxproj | 9 +++++++-- win_build/sim_vs2019.vcxproj | 9 +++++++-- win_build/sleeper_vs2019.vcxproj | 13 +++++++++---- win_build/uc2_vs2019.vcxproj | 15 +++++++++------ win_build/unittests_vs2019.vcxproj | 2 +- win_build/vboxwrapper_vs2019.vcxproj | 15 +++++++++------ win_build/wrapper_vs2019.vcxproj | 15 +++++++++------ win_build/wrappture_example_vs2019.vcxproj | 11 +++++++---- 18 files changed, 145 insertions(+), 71 deletions(-) diff --git a/win_build/boinc_os_ss_vs2019.vcxproj b/win_build/boinc_os_ss_vs2019.vcxproj index 34e91b1fa24..1ca96d7d4f2 100644 --- a/win_build/boinc_os_ss_vs2019.vcxproj +++ b/win_build/boinc_os_ss_vs2019.vcxproj @@ -74,7 +74,7 @@ Disabled - ../win_build;../;../api/;../lib;../client/;../coprocs/OpenCL/include;%(AdditionalIncludeDirectories) + ../win_build;../;../api/;../lib;../client/;../coprocs/OpenCL/include;%(AdditionalIncludeDirectories);$(VcpkgInstalledDir)/include WIN32;_WINDOWS;_CONSOLE;%(PreprocessorDefinitions) Async EnableFastChecks @@ -100,7 +100,7 @@ ../;%(AdditionalIncludeDirectories) - libcmtd.lib;libcpmtd.lib;opengl32.lib;glu32.lib;wsock32.lib;wininet.lib;winmm.lib;kernel32.lib;user32.lib;gdi32.lib;advapi32.lib;comctl32.lib;msimg32.lib;shell32.lib;userenv.lib + libcmtd.lib;libcpmtd.lib;opengl32.lib;glu32.lib;wsock32.lib;wininet.lib;winmm.lib;kernel32.lib;user32.lib;gdi32.lib;advapi32.lib;comctl32.lib;msimg32.lib;shell32.lib;userenv.lib;tinyxml2d.lib true false %(IgnoreSpecificDefaultLibraries) @@ -112,6 +112,7 @@ MachineX64 + $(VcpkgInstalledDir)/debug/lib @@ -126,7 +127,7 @@ Full - ../win_build;../api/;../lib/;../client;..;../coprocs/OpenCL/include;%(AdditionalIncludeDirectories) + ../win_build;../api/;../lib/;../client;..;../coprocs/OpenCL/include;%(AdditionalIncludeDirectories);$(VcpkgInstalledDir)/include WIN32;NDEBUG;_WINDOWS;_CONSOLE;%(PreprocessorDefinitions) false Async @@ -152,7 +153,7 @@ ..;%(AdditionalIncludeDirectories) - libcmt.lib;libcpmt.lib;opengl32.lib;glu32.lib;wsock32.lib;wininet.lib;winmm.lib;kernel32.lib;user32.lib;gdi32.lib;advapi32.lib;comctl32.lib;msimg32.lib;shell32.lib;userenv.lib + libcmt.lib;libcpmt.lib;opengl32.lib;glu32.lib;wsock32.lib;wininet.lib;winmm.lib;kernel32.lib;user32.lib;gdi32.lib;advapi32.lib;comctl32.lib;msimg32.lib;shell32.lib;userenv.lib;tinyxml2.lib NotSet true false @@ -162,6 +163,7 @@ true true MachineX64 + $(VcpkgInstalledDir)/lib @@ -239,6 +241,11 @@ + + + {d3e5b5b5-4fb1-4877-9b2c-6708b3d568f7} + + diff --git a/win_build/boinccas_vs2019.vcxproj b/win_build/boinccas_vs2019.vcxproj index 2a202c69ba8..7ad7f1cd001 100644 --- a/win_build/boinccas_vs2019.vcxproj +++ b/win_build/boinccas_vs2019.vcxproj @@ -1,5 +1,6 @@  + Debug @@ -70,10 +71,10 @@ Level4 false ProgramDatabase - ../win_build;..\lib;%(AdditionalIncludeDirectories) + ../win_build;..\lib;%(AdditionalIncludeDirectories);$(VcpkgInstalledDir)/include - atls.lib;msi.lib;libcmtd.lib;libcpmtd.lib;delayimp.lib;netapi32.lib;advapi32.lib;kernel32.lib;user32.lib;version.lib;%(AdditionalDependencies) + atls.lib;msi.lib;libcmtd.lib;libcpmtd.lib;delayimp.lib;netapi32.lib;advapi32.lib;kernel32.lib;user32.lib;version.lib;tinyxml2d.lib;%(AdditionalDependencies) false ..\clientsetup\win\boinccas.def netapi32.dll;advapi32.dll;%(DelayLoadDLLs) @@ -82,7 +83,7 @@ Windows $(OutDir)boinccas.lib MachineX64 - $(OutDir);%(AdditionalLibraryDirectories) + $(OutDir);$(VcpkgInstalledDir)/debug/lib;%(AdditionalLibraryDirectories) @@ -100,10 +101,10 @@ Use Level3 ProgramDatabase - ..\lib;../win_build;%(AdditionalIncludeDirectories) + ..\lib;../win_build;%(AdditionalIncludeDirectories);$(VcpkgInstalledDir)/include - atls.lib;msi.lib;libcmt.lib;libcpmt.lib;delayimp.lib;netapi32.lib;advapi32.lib;kernel32.lib;user32.lib;version.lib;%(AdditionalDependencies) + atls.lib;msi.lib;libcmt.lib;libcpmt.lib;delayimp.lib;netapi32.lib;advapi32.lib;kernel32.lib;user32.lib;version.lib;tinyxml2.lib;%(AdditionalDependencies) false ..\clientsetup\win\boinccas.def netapi32.dll;advapi32.dll;%(DelayLoadDLLs) @@ -114,7 +115,7 @@ true $(OutDir)boinccas.lib MachineX64 - $(OutDir);%(AdditionalLibraryDirectories) + $(OutDir);$(VcpkgInstalledDir)/lib;%(AdditionalLibraryDirectories) @@ -245,6 +246,9 @@ {e8f6bd7e-461a-4733-b7d8-37b09a099ed8} + + {d3e5b5b5-4fb1-4877-9b2c-6708b3d568f7} + diff --git a/win_build/boinccmd_vs2019.vcxproj b/win_build/boinccmd_vs2019.vcxproj index a72d7069cca..5e9fd5f6369 100644 --- a/win_build/boinccmd_vs2019.vcxproj +++ b/win_build/boinccmd_vs2019.vcxproj @@ -70,7 +70,7 @@ Disabled - ../win_build;../lib/;../api/;../RSAEuro/source/;../client/win/;../client;..;../coprocs/OpenCL/include;%(AdditionalIncludeDirectories) + ../win_build;../lib/;../api/;../RSAEuro/source/;../client/win/;../client;..;../coprocs/OpenCL/include;$(VcpkgInstalledDir)/include;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;_CONSOLE;%(PreprocessorDefinitions) Async EnableFastChecks @@ -97,7 +97,7 @@ ..;%(AdditionalIncludeDirectories) - kernel32.lib;user32.lib;advapi32.lib;wsock32.lib;wininet.lib;winmm.lib;oldnames.lib;%(AdditionalDependencies) + kernel32.lib;user32.lib;advapi32.lib;wsock32.lib;wininet.lib;winmm.lib;oldnames.lib;tinyxml2d.lib;%(AdditionalDependencies) true false %(IgnoreSpecificDefaultLibraries) @@ -107,6 +107,7 @@ MachineX64 + $(VcpkgInstalledDir)/debug/lib @@ -122,7 +123,7 @@ MaxSpeed OnlyExplicitInline - ../win_build;../lib/;../api/;../RSAEuro/source/;../client/win/;../client;..;../coprocs/OpenCL/include;%(AdditionalIncludeDirectories) + ../win_build;../lib/;../api/;../RSAEuro/source/;../client/win/;../client;..;../coprocs/OpenCL/include;$(VcpkgInstalledDir)/include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_CONSOLE;%(PreprocessorDefinitions) true Async @@ -148,7 +149,7 @@ ..;%(AdditionalIncludeDirectories) - kernel32.lib;user32.lib;advapi32.lib;wsock32.lib;wininet.lib;winmm.lib;oldnames.lib;%(AdditionalDependencies) + kernel32.lib;user32.lib;advapi32.lib;wsock32.lib;wininet.lib;winmm.lib;oldnames.lib;tinyxml2.lib;%(AdditionalDependencies) NotSet true false @@ -159,6 +160,7 @@ true true MachineX64 + $(VcpkgInstalledDir)/lib @@ -188,6 +190,9 @@ {e8f6bd7e-461a-4733-b7d8-37b09a099ed8} false + + {d3e5b5b5-4fb1-4877-9b2c-6708b3d568f7} + diff --git a/win_build/boinclog_vs2019.vcxproj b/win_build/boinclog_vs2019.vcxproj index c3866f5dd9e..43e1793c84c 100644 --- a/win_build/boinclog_vs2019.vcxproj +++ b/win_build/boinclog_vs2019.vcxproj @@ -70,7 +70,7 @@ Disabled - ../win_build;../lib/;../api/;../RSAEuro/source/;../client/win/;../client;..;../coprocs/OpenCL/include;%(AdditionalIncludeDirectories) + ../win_build;../lib/;../api/;../RSAEuro/source/;../client/win/;../client;..;../coprocs/OpenCL/include;$(VcpkgInstalledDir)/include;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;_CONSOLE;%(PreprocessorDefinitions) Async EnableFastChecks @@ -97,7 +97,7 @@ ..;%(AdditionalIncludeDirectories) - kernel32.lib;user32.lib;advapi32.lib;wsock32.lib;wininet.lib;winmm.lib;oldnames.lib;%(AdditionalDependencies) + kernel32.lib;user32.lib;advapi32.lib;wsock32.lib;wininet.lib;winmm.lib;oldnames.lib;tinyxml2d.lib;%(AdditionalDependencies) true false %(IgnoreSpecificDefaultLibraries) @@ -107,6 +107,7 @@ MachineX64 + $(VcpkgInstalledDir)/debug/lib @@ -122,7 +123,7 @@ MaxSpeed OnlyExplicitInline - ../win_build;../lib/;../api/;../RSAEuro/source/;../client/win/;../client;..;../coprocs/OpenCL/include;%(AdditionalIncludeDirectories) + ../win_build;../lib/;../api/;../RSAEuro/source/;../client/win/;../client;..;../coprocs/OpenCL/include;$(VcpkgInstalledDir)/include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_CONSOLE;%(PreprocessorDefinitions) true Async @@ -148,7 +149,7 @@ ..;%(AdditionalIncludeDirectories) - kernel32.lib;user32.lib;advapi32.lib;wsock32.lib;wininet.lib;winmm.lib;oldnames.lib;%(AdditionalDependencies) + kernel32.lib;user32.lib;advapi32.lib;wsock32.lib;wininet.lib;winmm.lib;oldnames.lib;tinyxml2.lib;%(AdditionalDependencies) NotSet true false @@ -159,6 +160,7 @@ true true MachineX64 + $(VcpkgInstalledDir)/lib @@ -188,6 +190,9 @@ {e8f6bd7e-461a-4733-b7d8-37b09a099ed8} false + + {d3e5b5b5-4fb1-4877-9b2c-6708b3d568f7} + diff --git a/win_build/boincmgr_vs2019.vcxproj b/win_build/boincmgr_vs2019.vcxproj index cde56db6930..1612fe678f5 100644 --- a/win_build/boincmgr_vs2019.vcxproj +++ b/win_build/boincmgr_vs2019.vcxproj @@ -83,7 +83,7 @@ $(VcpkgInstalledDir)/include/;..;%(AdditionalIncludeDirectories) - kernel32.lib;user32.lib;gdi32.lib;ole32.lib;oleacc.lib;oleaut32.lib;shell32.lib;comdlg32.lib;advapi32.lib;oldnames.lib;uuid.lib;rpcrt4.lib;comctl32.lib;wsock32.lib;wininet.lib;userenv.lib;winspool.lib;wxbase31u.lib;wxbase31u_net.lib;wxbase31u_xml.lib;wxmsw31u_adv.lib;wxmsw31u_core.lib;wxmsw31u_html.lib;wxmsw31u_qa.lib;wxmsw31u_webview.lib;wxregexu.lib;libpng16.lib;jpeg.lib;tiff.lib;zlib.lib;lzma.lib + kernel32.lib;user32.lib;gdi32.lib;ole32.lib;oleacc.lib;oleaut32.lib;shell32.lib;comdlg32.lib;advapi32.lib;oldnames.lib;uuid.lib;rpcrt4.lib;comctl32.lib;wsock32.lib;wininet.lib;userenv.lib;winspool.lib;wxbase31u.lib;wxbase31u_net.lib;wxbase31u_xml.lib;wxmsw31u_adv.lib;wxmsw31u_core.lib;wxmsw31u_html.lib;wxmsw31u_qa.lib;wxmsw31u_webview.lib;wxregexu.lib;libpng16.lib;jpeg.lib;tiff.lib;zlib.lib;lzma.lib;tinyxml2.lib $(OutDir);$(VcpkgInstalledDir)/lib;%(AdditionalLibraryDirectories) false true @@ -130,7 +130,7 @@ $(VcpkgInstalledDir)/include/;..;%(AdditionalIncludeDirectories) - kernel32.lib;user32.lib;gdi32.lib;ole32.lib;oleaut32.lib;oleacc.lib;shell32.lib;comdlg32.lib;advapi32.lib;oldnames.lib;uuid.lib;rpcrt4.lib;comctl32.lib;wsock32.lib;wininet.lib;userenv.lib;winspool.lib;wxbase31ud.lib;wxbase31ud_net.lib;wxbase31ud_xml.lib;wxmsw31ud_adv.lib;wxmsw31ud_core.lib;wxmsw31ud_html.lib;wxmsw31ud_qa.lib;wxmsw31ud_webview.lib;wxregexud.lib;libpng16d.lib;jpegd.lib;tiffd.lib;zlibd.lib;lzmad.lib + kernel32.lib;user32.lib;gdi32.lib;ole32.lib;oleaut32.lib;oleacc.lib;shell32.lib;comdlg32.lib;advapi32.lib;oldnames.lib;uuid.lib;rpcrt4.lib;comctl32.lib;wsock32.lib;wininet.lib;userenv.lib;winspool.lib;wxbase31ud.lib;wxbase31ud_net.lib;wxbase31ud_xml.lib;wxmsw31ud_adv.lib;wxmsw31ud_core.lib;wxmsw31ud_html.lib;wxmsw31ud_qa.lib;wxmsw31ud_webview.lib;wxregexud.lib;libpng16d.lib;jpegd.lib;tiffd.lib;zlibd.lib;lzmad.lib;tinyxml2d.lib $(OutDir);$(VcpkgInstalledDir)/debug/lib;%(AdditionalLibraryDirectories) false true @@ -367,6 +367,11 @@ + + + {d3e5b5b5-4fb1-4877-9b2c-6708b3d568f7} + + diff --git a/win_build/example_app_multi_thread_vs2019.vcxproj b/win_build/example_app_multi_thread_vs2019.vcxproj index 0aec3a7cc2e..c02acee4ed6 100644 --- a/win_build/example_app_multi_thread_vs2019.vcxproj +++ b/win_build/example_app_multi_thread_vs2019.vcxproj @@ -77,7 +77,7 @@ MaxSpeed OnlyExplicitInline Speed - .;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include;%(AdditionalIncludeDirectories) + .;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include;$(VcpkgInstalledDir)/include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) false Sync @@ -98,7 +98,7 @@ 0x0409 - libcmt.lib;libcpmt.lib;opengl32.lib;glu32.lib;odbc32.lib;odbccp32.lib;psapi.lib;%(AdditionalDependencies) + libcmt.lib;libcpmt.lib;opengl32.lib;glu32.lib;odbc32.lib;odbccp32.lib;psapi.lib;tinyxml2.lib;%(AdditionalDependencies) true false %(DelayLoadDLLs) @@ -106,6 +106,7 @@ .\Build\$(Platform)\$(Configuration)\multi_thread_6.1_windows_x86_64.pdb Console MachineX64 + $(VcpkgInstalledDir)/lib @@ -121,7 +122,7 @@ Disabled - .;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include;%(AdditionalIncludeDirectories) + .;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include;$(VcpkgInstalledDir)/include;%(AdditionalIncludeDirectories) WIN32;_CONSOLE;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug @@ -140,7 +141,7 @@ 0x0409 - libcmtd.lib;libcpmtd.lib;kernel32.lib;user32.lib;gdi32.lib;opengl32.lib;glu32.lib;ole32.lib;psapi.lib;delayimp.lib;%(AdditionalDependencies) + libcmtd.lib;libcpmtd.lib;kernel32.lib;user32.lib;gdi32.lib;opengl32.lib;glu32.lib;ole32.lib;psapi.lib;delayimp.lib;tinyxml2d.lib;%(AdditionalDependencies) true false %(DelayLoadDLLs) @@ -148,6 +149,7 @@ .\Build\$(Platform)\$(Configuration)\multi_thread_6.1_windows_x86_64.pdb Console MachineX64 + $(VcpkgInstalledDir)/debug/lib @@ -165,6 +167,9 @@ {814ebfd3-3ce6-4933-a580-c1fe3147acb4} false + + {d3e5b5b5-4fb1-4877-9b2c-6708b3d568f7} + diff --git a/win_build/example_app_nvcuda_vs2019.vcxproj b/win_build/example_app_nvcuda_vs2019.vcxproj index e617931dbf7..b602e333b56 100644 --- a/win_build/example_app_nvcuda_vs2019.vcxproj +++ b/win_build/example_app_nvcuda_vs2019.vcxproj @@ -66,7 +66,7 @@ Disabled - .;..;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;$(CUDA_INC_PATH);%(AdditionalIncludeDirectories) + .;..;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;$(CUDA_INC_PATH);$(VcpkgInstalledDir)/include;%(AdditionalIncludeDirectories) WIN32;_CONSOLE;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug @@ -75,8 +75,8 @@ Level4 - cudart.lib;%(AdditionalDependencies) - $(CUDA_LIB_PATH)/x64;%(AdditionalLibraryDirectories) + cudart.lib;tinyxml2d.lib;%(AdditionalDependencies) + $(CUDA_LIB_PATH)/x64;$(VcpkgInstalledDir)/debug/lib;%(AdditionalLibraryDirectories) true .\Build\$(Platform)\$(Configuration)\$(ProjectName).pdb Console @@ -92,7 +92,7 @@ X64 - .;..;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;$(CUDA_INC_PATH);%(AdditionalIncludeDirectories) + .;..;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;$(CUDA_INC_PATH);$(VcpkgInstalledDir)/include;%(AdditionalIncludeDirectories) WIN32;_NDEBUG;_CONSOLE;%(PreprocessorDefinitions) MultiThreaded @@ -100,8 +100,8 @@ Level4 - cudart.lib;%(AdditionalDependencies) - $(CUDA_LIB_PATH)/x64;%(AdditionalLibraryDirectories) + cudart.lib;tinyxml2.lib;%(AdditionalDependencies) + $(CUDA_LIB_PATH)/x64;$(VcpkgInstalledDir)/lib;%(AdditionalLibraryDirectories) true .\Build\$(Platform)\$(Configuration)\$(ProjectName).pdb Console @@ -133,6 +133,9 @@ {e8f6bd7e-461a-4733-b7d8-37b09a099ed8} + + {d3e5b5b5-4fb1-4877-9b2c-6708b3d568f7} + diff --git a/win_build/htmlgfx_vs2019.vcxproj b/win_build/htmlgfx_vs2019.vcxproj index abaa2acb3e2..986f62c7a2a 100644 --- a/win_build/htmlgfx_vs2019.vcxproj +++ b/win_build/htmlgfx_vs2019.vcxproj @@ -75,7 +75,7 @@ MaxSpeed OnlyExplicitInline Speed - .;../;$(IntDir);../api;../lib;%(AdditionalIncludeDirectories) + .;../;$(IntDir);../api;../lib;$(VcpkgInstalledDir)/include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_ATL_DISABLE_NOTHROW_NEW;%(PreprocessorDefinitions) false Sync @@ -97,7 +97,7 @@ $(IntDir);..;%(AdditionalIncludeDirectories) - libcmt.lib;libcpmt.lib;atls.lib;comsuppw.lib;urlmon.lib;kernel32.lib;user32.lib;gdi32.lib;ole32.lib;wsock32.lib;psapi.lib;%(AdditionalDependencies) + libcmt.lib;libcpmt.lib;atls.lib;comsuppw.lib;urlmon.lib;kernel32.lib;user32.lib;gdi32.lib;ole32.lib;wsock32.lib;psapi.lib;tinyxml2.lib;%(AdditionalDependencies) true false %(DelayLoadDLLs) @@ -105,7 +105,7 @@ $(TargetDir)\$(TargetName).pdb Windows MachineX64 - $(TargetDir) + $(TargetDir);$(VcpkgInstalledDir)/lib @@ -121,7 +121,7 @@ Disabled - .;../;$(IntDir);../api;../lib;%(AdditionalIncludeDirectories) + .;../;$(IntDir);../api;../lib;$(VcpkgInstalledDir)/include;%(AdditionalIncludeDirectories) WIN32;_CONSOLE;_ATL_DISABLE_NOTHROW_NEW;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug @@ -141,7 +141,7 @@ $(IntDir);..;%(AdditionalIncludeDirectories) - libcmtd.lib;libcpmtd.lib;atls.lib;comsuppwd.lib;urlmon.lib;kernel32.lib;user32.lib;gdi32.lib;ole32.lib;wsock32.lib;psapi.lib;%(AdditionalDependencies) + libcmtd.lib;libcpmtd.lib;atls.lib;comsuppwd.lib;urlmon.lib;kernel32.lib;user32.lib;gdi32.lib;ole32.lib;wsock32.lib;psapi.lib;tinyxml2d.lib;%(AdditionalDependencies) true false %(DelayLoadDLLs) @@ -149,7 +149,7 @@ $(TargetDir)\$(TargetName).pdb Windows MachineX64 - $(TargetDir) + $(TargetDir);$(VcpkgInstalledDir)/debug/lib @@ -208,6 +208,9 @@ {814ebfd3-3ce6-4933-a580-c1fe3147acb4} + + {d3e5b5b5-4fb1-4877-9b2c-6708b3d568f7} + diff --git a/win_build/libboincapi_staticcrt_vs2019.vcxproj b/win_build/libboincapi_staticcrt_vs2019.vcxproj index 56525bab791..e7be8d11fd4 100644 --- a/win_build/libboincapi_staticcrt_vs2019.vcxproj +++ b/win_build/libboincapi_staticcrt_vs2019.vcxproj @@ -58,7 +58,7 @@ Disabled - .;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include;%(AdditionalIncludeDirectories) + .;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include;$(VcpkgInstalledDir)/include;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;_CONSOLE;CLIENT;BOINC_APP_GRAPHICS;%(PreprocessorDefinitions) Async EnableFastChecks @@ -77,7 +77,7 @@ X64 - .;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include;%(AdditionalIncludeDirectories) + .;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include;$(VcpkgInstalledDir)/include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_LIB;_CONSOLE;CLIENT;BOINC_APP_GRAPHICS;%(PreprocessorDefinitions) Async MultiThreaded @@ -102,6 +102,11 @@ + + + {d3e5b5b5-4fb1-4877-9b2c-6708b3d568f7} + + diff --git a/win_build/libboincopencl_staticcrt_vs2019.vcxproj b/win_build/libboincopencl_staticcrt_vs2019.vcxproj index 408864fd874..221bdb15af3 100644 --- a/win_build/libboincopencl_staticcrt_vs2019.vcxproj +++ b/win_build/libboincopencl_staticcrt_vs2019.vcxproj @@ -58,7 +58,7 @@ Disabled - .;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include;%(AdditionalIncludeDirectories) + .;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include;$(VcpkgInstalledDir)/include;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;_CONSOLE;CLIENT;BOINC_APP_GRAPHICS;%(PreprocessorDefinitions) Async EnableFastChecks @@ -77,7 +77,7 @@ X64 - .;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include;%(AdditionalIncludeDirectories) + .;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include;$(VcpkgInstalledDir)/include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_LIB;_CONSOLE;CLIENT;BOINC_APP_GRAPHICS;%(PreprocessorDefinitions) Async MultiThreaded @@ -103,6 +103,11 @@ + + + {d3e5b5b5-4fb1-4877-9b2c-6708b3d568f7} + + diff --git a/win_build/libgraphics2_vs2019.vcxproj b/win_build/libgraphics2_vs2019.vcxproj index 7f44d3c831e..2bc35acb4a9 100644 --- a/win_build/libgraphics2_vs2019.vcxproj +++ b/win_build/libgraphics2_vs2019.vcxproj @@ -58,7 +58,7 @@ Disabled - .;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include;%(AdditionalIncludeDirectories) + .;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include;$(VcpkgInstalledDir)/include;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;_CONSOLE;CLIENT;BOINC_APP_GRAPHICS;%(PreprocessorDefinitions) Async EnableFastChecks @@ -76,7 +76,7 @@ X64 - .;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include;%(AdditionalIncludeDirectories) + .;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include;$(VcpkgInstalledDir)/include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_LIB;_CONSOLE;CLIENT;BOINC_APP_GRAPHICS;%(PreprocessorDefinitions) Async MultiThreaded @@ -132,6 +132,11 @@ + + + {d3e5b5b5-4fb1-4877-9b2c-6708b3d568f7} + + diff --git a/win_build/sim_vs2019.vcxproj b/win_build/sim_vs2019.vcxproj index e86ea07c2d5..88e809a8a20 100644 --- a/win_build/sim_vs2019.vcxproj +++ b/win_build/sim_vs2019.vcxproj @@ -96,7 +96,7 @@ ..;%(AdditionalIncludeDirectories) - kernel32.lib;user32.lib;advapi32.lib;wsock32.lib;wininet.lib;winmm.lib;oldnames.lib;zlibd.lib;libcrypto.lib;libssl.lib;libcurl-d.lib;%(AdditionalDependencies);Ws2_32.Lib;Crypt32.Lib;Wldap32.Lib + kernel32.lib;user32.lib;advapi32.lib;wsock32.lib;wininet.lib;winmm.lib;oldnames.lib;zlibd.lib;libcrypto.lib;libssl.lib;libcurl-d.lib;%(AdditionalDependencies);Ws2_32.Lib;Crypt32.Lib;Wldap32.Lib;tinyxml2d.lib true false %(IgnoreSpecificDefaultLibraries) @@ -148,7 +148,7 @@ ..;%(AdditionalIncludeDirectories) - kernel32.lib;user32.lib;advapi32.lib;wsock32.lib;wininet.lib;winmm.lib;oldnames.lib;zlib.lib;libcrypto.lib;libssl.lib;libcurl.lib;%(AdditionalDependencies);Ws2_32.Lib;Crypt32.Lib;Wldap32.Lib + kernel32.lib;user32.lib;advapi32.lib;wsock32.lib;wininet.lib;winmm.lib;oldnames.lib;zlib.lib;libcrypto.lib;libssl.lib;libcurl.lib;%(AdditionalDependencies);Ws2_32.Lib;Crypt32.Lib;Wldap32.Lib;tinyxml2.lib NotSet true false @@ -244,6 +244,11 @@ + + + {d3e5b5b5-4fb1-4877-9b2c-6708b3d568f7} + + diff --git a/win_build/sleeper_vs2019.vcxproj b/win_build/sleeper_vs2019.vcxproj index 7deecc73792..6dc2a243f68 100644 --- a/win_build/sleeper_vs2019.vcxproj +++ b/win_build/sleeper_vs2019.vcxproj @@ -76,7 +76,7 @@ MaxSpeed OnlyExplicitInline Speed - ../win_build;.;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include;%(AdditionalIncludeDirectories) + ../win_build;.;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include;$(VcpkgInstalledDir)/include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) false Sync @@ -97,7 +97,7 @@ 0x0409 - libcmt.lib;libcpmt.lib;kernel32.lib;user32.lib;gdi32.lib;opengl32.lib;psapi.lib;glu32.lib;ole32.lib;psapi.lib;%(AdditionalDependencies) + libcmt.lib;libcpmt.lib;kernel32.lib;user32.lib;gdi32.lib;opengl32.lib;psapi.lib;glu32.lib;ole32.lib;tinyxml2.lib;%(AdditionalDependencies) true false %(DelayLoadDLLs) @@ -105,6 +105,7 @@ .\Build\$(Platform)\$(Configuration)\sleeper_6.1_windows_x86_64.pdb Console MachineX64 + $(VcpkgInstalledDir)/lib @@ -120,7 +121,7 @@ Disabled - ../win_build;.;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include;%(AdditionalIncludeDirectories) + ../win_build;.;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include;$(VcpkgInstalledDir)/include;%(AdditionalIncludeDirectories) WIN32;_CONSOLE;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug @@ -139,7 +140,7 @@ 0x0409 - libcmtd.lib;libcpmtd.lib;kernel32.lib;user32.lib;gdi32.lib;opengl32.lib;glu32.lib;ole32.lib;psapi.lib;%(AdditionalDependencies) + libcmtd.lib;libcpmtd.lib;kernel32.lib;user32.lib;gdi32.lib;opengl32.lib;glu32.lib;ole32.lib;psapi.lib;tinyxml2d.lib;%(AdditionalDependencies) true false %(DelayLoadDLLs) @@ -147,6 +148,7 @@ .\Build\$(Platform)\$(Configuration)\sleeper_6.1_windows_x86_64.pdb Console MachineX64 + $(VcpkgInstalledDir)/debug/lib @@ -160,6 +162,9 @@ {e8f6bd7e-461a-4733-b7d8-37b09a099ed8} + + {d3e5b5b5-4fb1-4877-9b2c-6708b3d568f7} + diff --git a/win_build/uc2_vs2019.vcxproj b/win_build/uc2_vs2019.vcxproj index b17c289ff09..7cf7c0d19fa 100644 --- a/win_build/uc2_vs2019.vcxproj +++ b/win_build/uc2_vs2019.vcxproj @@ -70,7 +70,7 @@ MaxSpeed OnlyExplicitInline Speed - .;..;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include;%(AdditionalIncludeDirectories) + .;..;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include;$(VcpkgInstalledDir)/include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) false Sync @@ -91,7 +91,7 @@ 0x0409 - opengl32.lib;glu32.lib;odbc32.lib;odbccp32.lib;psapi.lib;libcmt.lib;libcpmt.lib;%(AdditionalDependencies) + opengl32.lib;glu32.lib;odbc32.lib;odbccp32.lib;psapi.lib;libcmt.lib;libcpmt.lib;tinyxml2.lib;%(AdditionalDependencies) true false %(DelayLoadDLLs) @@ -99,7 +99,7 @@ .\Build\$(Platform)\$(Configuration)\$(ProjectName).pdb Console MachineX64 - $(OutDir) + $(OutDir);$(VcpkgInstalledDir)/lib @@ -115,7 +115,7 @@ Disabled - .;..;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include;%(AdditionalIncludeDirectories) + .;..;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include;$(VcpkgInstalledDir)/include;%(AdditionalIncludeDirectories) WIN32;_CONSOLE;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug @@ -134,7 +134,7 @@ 0x0409 - libcmtd.lib;libcpmtd.lib;kernel32.lib;user32.lib;gdi32.lib;opengl32.lib;glu32.lib;ole32.lib;psapi.lib;delayimp.lib;%(AdditionalDependencies) + libcmtd.lib;libcpmtd.lib;kernel32.lib;user32.lib;gdi32.lib;opengl32.lib;glu32.lib;ole32.lib;psapi.lib;delayimp.lib;tinyxml2d.lib;%(AdditionalDependencies) true false %(DelayLoadDLLs) @@ -142,7 +142,7 @@ .\Build\$(Platform)\$(Configuration)\$(ProjectName).pdb Console MachineX64 - $(OutDir) + $(OutDir);$(VcpkgInstalledDir)/debug/lib @@ -163,6 +163,9 @@ {b275c525-5ef4-40ba-a70a-4e01a76a0cdd} + + {d3e5b5b5-4fb1-4877-9b2c-6708b3d568f7} + diff --git a/win_build/unittests_vs2019.vcxproj b/win_build/unittests_vs2019.vcxproj index 01517c9a344..9d01c31f771 100644 --- a/win_build/unittests_vs2019.vcxproj +++ b/win_build/unittests_vs2019.vcxproj @@ -103,4 +103,4 @@ - \ No newline at end of file + diff --git a/win_build/vboxwrapper_vs2019.vcxproj b/win_build/vboxwrapper_vs2019.vcxproj index 06d4dae37b2..cde9e4397b0 100644 --- a/win_build/vboxwrapper_vs2019.vcxproj +++ b/win_build/vboxwrapper_vs2019.vcxproj @@ -75,7 +75,7 @@ MaxSpeed OnlyExplicitInline Speed - .;../;../api;../lib;%(AdditionalIncludeDirectories) + .;../;../api;../lib;$(VcpkgInstalledDir)/include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;_ATL_DISABLE_NOTHROW_NEW;%(PreprocessorDefinitions) false Sync @@ -97,7 +97,7 @@ ..;%(AdditionalIncludeDirectories) - libcmt.lib;libcpmt.lib;atls.lib;comsuppw.lib;kernel32.lib;user32.lib;gdi32.lib;ole32.lib;wsock32.lib;psapi.lib;%(AdditionalDependencies) + libcmt.lib;libcpmt.lib;atls.lib;comsuppw.lib;kernel32.lib;user32.lib;gdi32.lib;ole32.lib;wsock32.lib;psapi.lib;tinyxml2.lib;%(AdditionalDependencies) true false %(DelayLoadDLLs) @@ -105,7 +105,7 @@ $(TargetDir)\$(TargetName).pdb Console MachineX64 - $(TargetDir) + $(TargetDir);$(VcpkgInstalledDir)/lib @@ -121,7 +121,7 @@ Disabled - .;../;../api;../lib;%(AdditionalIncludeDirectories) + .;../;../api;../lib;$(VcpkgInstalledDir)/include;%(AdditionalIncludeDirectories) WIN32;_CONSOLE;_ATL_DISABLE_NOTHROW_NEW;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug @@ -141,7 +141,7 @@ ..;%(AdditionalIncludeDirectories) - libcmtd.lib;libcpmtd.lib;atls.lib;comsuppwd.lib;kernel32.lib;user32.lib;gdi32.lib;ole32.lib;wsock32.lib;psapi.lib;%(AdditionalDependencies) + libcmtd.lib;libcpmtd.lib;atls.lib;comsuppwd.lib;kernel32.lib;user32.lib;gdi32.lib;ole32.lib;wsock32.lib;psapi.lib;tinyxml2d.lib;%(AdditionalDependencies) true false %(DelayLoadDLLs) @@ -149,7 +149,7 @@ $(TargetDir)\$(TargetName).pdb Console MachineX64 - $(TargetDir) + $(TargetDir);$(VcpkgInstalledDir)/debug/lib @@ -195,6 +195,9 @@ {814ebfd3-3ce6-4933-a580-c1fe3147acb4} + + {d3e5b5b5-4fb1-4877-9b2c-6708b3d568f7} + diff --git a/win_build/wrapper_vs2019.vcxproj b/win_build/wrapper_vs2019.vcxproj index 28c52111677..6caf4b5dce1 100644 --- a/win_build/wrapper_vs2019.vcxproj +++ b/win_build/wrapper_vs2019.vcxproj @@ -72,7 +72,7 @@ MaxSpeed OnlyExplicitInline Speed - .;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../zip;../coprocs/OpenCL/include;%(AdditionalIncludeDirectories) + .;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../zip;../coprocs/OpenCL/include;$(VcpkgInstalledDir)/include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) false Sync @@ -95,7 +95,7 @@ ..;%(AdditionalIncludeDirectories) - libcmt.lib;libcpmt.lib;kernel32.lib;user32.lib;gdi32.lib;ole32.lib;psapi.lib;oldnames.lib;%(AdditionalDependencies) + libcmt.lib;libcpmt.lib;kernel32.lib;user32.lib;gdi32.lib;ole32.lib;psapi.lib;oldnames.lib;tinyxml2.lib;%(AdditionalDependencies) true false %(DelayLoadDLLs) @@ -103,7 +103,7 @@ .\Build\$(Platform)\$(Configuration)\$(TargetName).pdb Console MachineX64 - $(TargetDir) + $(TargetDir);$(VcpkgInstalledDir)/lib UseLinkTimeCodeGeneration @@ -120,7 +120,7 @@ Disabled - .;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../zip;../coprocs/OpenCL/include;%(AdditionalIncludeDirectories) + .;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../zip;../coprocs/OpenCL/include;$(VcpkgInstalledDir)/include;%(AdditionalIncludeDirectories) WIN32;_CONSOLE;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug @@ -140,7 +140,7 @@ ..;%(AdditionalIncludeDirectories) - libcmtd.lib;libcpmtd.lib;kernel32.lib;user32.lib;gdi32.lib;ole32.lib;psapi.lib;oldnames.lib;%(AdditionalDependencies) + libcmtd.lib;libcpmtd.lib;kernel32.lib;user32.lib;gdi32.lib;ole32.lib;psapi.lib;oldnames.lib;tinyxml2d.lib;%(AdditionalDependencies) true false %(DelayLoadDLLs) @@ -148,7 +148,7 @@ .\Build\$(Platform)\$(Configuration)\$(TargetName).pdb Console MachineX64 - $(TargetDir) + $(TargetDir);$(VcpkgInstalledDir)/debug/lib @@ -179,6 +179,9 @@ {814ebfd3-3ce6-4933-a580-c1fe3147acb4} + + {d3e5b5b5-4fb1-4877-9b2c-6708b3d568f7} + diff --git a/win_build/wrappture_example_vs2019.vcxproj b/win_build/wrappture_example_vs2019.vcxproj index 902df9a2300..31e86bd0c62 100644 --- a/win_build/wrappture_example_vs2019.vcxproj +++ b/win_build/wrappture_example_vs2019.vcxproj @@ -77,7 +77,7 @@ MaxSpeed OnlyExplicitInline Speed - .;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include;$(VcpkgInstalledDir)/include/rappture;%(AdditionalIncludeDirectories) + .;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include;$(VcpkgInstalledDir)/include/rappture;$(VcpkgInstalledDir)/include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) false Sync @@ -98,7 +98,7 @@ 0x0409 - rappture.lib;libexpatMD.lib;libcmt.lib;libcpmt.lib;zlib.lib;%(AdditionalDependencies) + rappture.lib;libexpatMD.lib;libcmt.lib;libcpmt.lib;zlib.lib;tinyxml2.lib;%(AdditionalDependencies) true false %(DelayLoadDLLs) @@ -122,7 +122,7 @@ Disabled - .;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include;$(VcpkgInstalledDir)/include/rappture;%(AdditionalIncludeDirectories) + .;../;../api;../lib;../samples/image_libs;../samples/jpeglib;../samples/glut;../coprocs/OpenCL/include;$(VcpkgInstalledDir)/include/rappture;$(VcpkgInstalledDir)/include;%(AdditionalIncludeDirectories) WIN32;_CONSOLE;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug @@ -141,7 +141,7 @@ 0x0409 - rappture.lib;libexpatdMD.lib;libcmtd.lib;libcpmtd.lib;kernel32.lib;user32.lib;gdi32.lib;ole32.lib;zlibd.lib;%(AdditionalDependencies) + rappture.lib;libexpatdMD.lib;libcmtd.lib;libcpmtd.lib;kernel32.lib;user32.lib;gdi32.lib;ole32.lib;zlibd.lib;tinyxml2d.lib;%(AdditionalDependencies) true false %(DelayLoadDLLs) @@ -167,6 +167,9 @@ {e8f6bd7e-461a-4733-b7d8-37b09a099ed8} + + {d3e5b5b5-4fb1-4877-9b2c-6708b3d568f7} +