diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2012-12-11 03:51:03 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2012-12-11 03:51:03 +0000 |
commit | ae0b7c0063db6236be2d7cf01ddbf2159f77c98c (patch) | |
tree | 2f64d65d018634b8728623e2ca99514541fab8aa /sca-cpp/trunk/modules/xml/xsd-test.cpp | |
parent | 1f3796522a078dda5906395ba471d151ad694b6b (diff) |
Port kernel to C++11 and refactor some of the core modules. Convert functors to lambdas, and add C++ const, noexcept and inline annotations to get more efficient generated code.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1419985 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | sca-cpp/trunk/modules/xml/xsd-test.cpp (renamed from sca-cpp/trunk/kernel/xsd-test.cpp) | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sca-cpp/trunk/kernel/xsd-test.cpp b/sca-cpp/trunk/modules/xml/xsd-test.cpp index fbd2ee6dca..b10ad27379 100644 --- a/sca-cpp/trunk/kernel/xsd-test.cpp +++ b/sca-cpp/trunk/modules/xml/xsd-test.cpp @@ -30,11 +30,11 @@ namespace tuscany { -bool printNode(xmlTextReaderPtr reader) { +const bool printNode(xmlTextReaderPtr reader) { const xmlChar* name = xmlTextReaderConstName(reader); if(name == NULL) name = (xmlChar *)"<unknown>"; - const xmlChar* value = xmlTextReaderConstValue(reader); + const xmlChar* const value = xmlTextReaderConstValue(reader); cerr << xmlTextReaderDepth(reader) << " " << xmlTextReaderNodeType(reader) << " " << name << " " << xmlTextReaderIsEmptyElement(reader) << " " << xmlTextReaderHasValue(reader); if(value == NULL) @@ -53,7 +53,7 @@ int xmlClose(void *context) { return 0; } -bool readFile(const char*xsdfilename, const char *filename) { +const bool readFile(const char* const xsdfilename, const char* const filename) { cout << "Loading schema " << xsdfilename << endl; const xmlDocPtr xsddoc = xmlReadFile(xsdfilename, NULL, XML_PARSE_NONET); const xmlSchemaParserCtxtPtr xsdctx = xmlSchemaNewDocParserCtxt(xsddoc); @@ -61,7 +61,7 @@ bool readFile(const char*xsdfilename, const char *filename) { const xmlSchemaValidCtxtPtr validctx = xmlSchemaNewValidCtxt(xsd); cout << "Reading file " << filename << endl; - FILE* file = fopen(filename, "r"); + FILE* const file = fopen(filename, "r"); if (file != NULL) { const xmlTextReaderPtr reader = xmlReaderForIO(xmlRead, xmlClose, file, filename, NULL, XML_PARSE_NONET); xmlTextReaderSetParserProp(reader, XML_PARSER_DEFAULTATTRS, 1); @@ -93,7 +93,7 @@ bool readFile(const char*xsdfilename, const char *filename) { } -int main(int argc, char **argv) { +int main(const int argc, const char** const argv) { tuscany::cout << "Testing..." << tuscany::endl; if(argc != 3) return 1; |