From abff90399d75f4450fe98df74e9f21ad62e47069 Mon Sep 17 00:00:00 2001 From: Myun2 Date: Sun, 16 Jan 2011 18:23:18 +0900 Subject: [PATCH] xml_gen_test.cpp Add. --- roast/include/roast/lexical/debug_util.hpp | 2 ++ roast/include/roast/xml/roast_xml/roast_xml.hpp | 2 +- roast/test/lexical_test/roast_test_2nc.vcproj | 2 +- roast/test/lexical_test/xml_gen_test.cpp | 22 ++++++++++++++++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 roast/test/lexical_test/xml_gen_test.cpp diff --git a/roast/include/roast/lexical/debug_util.hpp b/roast/include/roast/lexical/debug_util.hpp index 3e9c02c1..05e7ae60 100644 --- a/roast/include/roast/lexical/debug_util.hpp +++ b/roast/include/roast/lexical/debug_util.hpp @@ -76,9 +76,11 @@ namespace roast ::std::string _get_name_it(const char* name, const char* it){ char work[32]; memset(work,0,sizeof(work)); +#pragma warning(disable:4996) strncpy(work, it, sizeof(work)-1); if ( strlen(work) == sizeof(work)-1 ) strncpy(work+(sizeof(work)-1-4), "...", 3); +#pragma warning(default:4996) ::std::string s = name; return s + " (it=\"" + work + "\")"; diff --git a/roast/include/roast/xml/roast_xml/roast_xml.hpp b/roast/include/roast/xml/roast_xml/roast_xml.hpp index f937ddfd..6a34598d 100644 --- a/roast/include/roast/xml/roast_xml/roast_xml.hpp +++ b/roast/include/roast/xml/roast_xml/roast_xml.hpp @@ -7,7 +7,7 @@ #include "roast/xml/roast_xml/rule_xml.hpp" //#include "roast/xml/roast_xml/dom.hpp" -#include "roast/xml/roast_xml/dom2.hpp" +#include "roast/xml/roast_xml/dom3.hpp" #include "roast/xml/roast_xml/sax.hpp" #include "roast/xml/roast_xml/rxpath.hpp" #include "roast/xml/roast_xml/sax_generator.hpp" diff --git a/roast/test/lexical_test/roast_test_2nc.vcproj b/roast/test/lexical_test/roast_test_2nc.vcproj index 83eef536..abb5456e 100644 --- a/roast/test/lexical_test/roast_test_2nc.vcproj +++ b/roast/test/lexical_test/roast_test_2nc.vcproj @@ -175,7 +175,7 @@ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" > diff --git a/roast/test/lexical_test/xml_gen_test.cpp b/roast/test/lexical_test/xml_gen_test.cpp new file mode 100644 index 00000000..d8253a3b --- /dev/null +++ b/roast/test/lexical_test/xml_gen_test.cpp @@ -0,0 +1,22 @@ +#include "roast/xml/roast_xml/rule_xml.hpp" + +using namespace roast::lexical; +using namespace roast::lexical::rule; +using namespace roast::roast_xml::rule; + +#pragma warning(disable:4996) +#pragma warning(disable:4102) + +/////////////////////////////////////////////////////////// + +ROAST_LEXICAL_FIXSTR(aaa, "aaa"); +ROAST_LEXICAL_FIXSTR(bbb, "bbb"); + +int main() +{ + printf("%s\n", str_generate >(null_document).c_str() ); + printf("%s\n", str_generate >(null_document).c_str() ); + printf("%s\n", str_generate >(null_document).c_str() ); + + return 0; +} -- 2.11.0