diff --git a/configure.ac b/configure.ac index 6682c31..7779538 100644 --- a/configure.ac +++ b/configure.ac @@ -179,7 +179,7 @@ AC_SUBST(ac_windows_dllexport) # This will (should) never change, but we put it here so if we do need # to change it, to avoid naming conflicts or something, it's easy to # do in one place. -ac_htmlparser_namespace=google_ctemplate_streamhtmlparser +ac_htmlparser_namespace=ctemplate_htmlparser AC_SUBST(ac_htmlparser_namespace) AC_DEFINE_UNQUOTED(HTMLPARSER_NAMESPACE, $ac_htmlparser_namespace, [The namespace to put the htmlparser code.]) diff --git a/src/ctemplate/template.h.in b/src/ctemplate/template.h.in index 90f6bea..c2201f8 100644 --- a/src/ctemplate/template.h.in +++ b/src/ctemplate/template.h.in @@ -57,7 +57,7 @@ class PerExpandData; } #endif -namespace @ac_htmlparser_namespace@ { +namespace ctemplate_htmlparser { class HtmlParser; } @@ -431,7 +431,7 @@ class @ac_windows_dllexport@ Template { TemplateContext initial_context_; // Non-null if the template was initialized in an Auto-Escape mode that // requires a parser (currently TC_HTML, TC_CSS and TC_JS). - @ac_htmlparser_namespace@::HtmlParser *htmlparser_; + ctemplate_htmlparser::HtmlParser *htmlparser_; // A sorted list of trusted variable names, declared here because a unittest // needs to verify that it is appropriately sorted (an unsorted array would diff --git a/src/htmlparser/htmlparser.cc b/src/htmlparser/htmlparser.cc index 4ee9cf0..749a74e 100644 --- a/src/htmlparser/htmlparser.cc +++ b/src/htmlparser/htmlparser.cc @@ -55,7 +55,7 @@ #endif #ifdef __cplusplus -namespace HTMLPARSER_NAMESPACE { +namespace ctemplate_htmlparser { #endif /* Generated state machine definition. */ diff --git a/src/htmlparser/htmlparser.h b/src/htmlparser/htmlparser.h index 3c7ebeb..120fb3e 100644 --- a/src/htmlparser/htmlparser.h +++ b/src/htmlparser/htmlparser.h @@ -50,7 +50,7 @@ #endif #ifdef __cplusplus -namespace HTMLPARSER_NAMESPACE { +namespace ctemplate_htmlparser { #endif /* entity filter */ diff --git a/src/htmlparser/htmlparser_cpp.h b/src/htmlparser/htmlparser_cpp.h index 8d87b23..0557783 100644 --- a/src/htmlparser/htmlparser_cpp.h +++ b/src/htmlparser/htmlparser_cpp.h @@ -40,7 +40,7 @@ #include "htmlparser/jsparser.h" #include "base/util.h" -namespace HTMLPARSER_NAMESPACE { +namespace ctemplate_htmlparser { class JavascriptParser { public: diff --git a/src/htmlparser/jsparser.cc b/src/htmlparser/jsparser.cc index 6f5a432..15be35d 100644 --- a/src/htmlparser/jsparser.cc +++ b/src/htmlparser/jsparser.cc @@ -49,7 +49,7 @@ #endif #ifdef __cplusplus -namespace HTMLPARSER_NAMESPACE { +namespace ctemplate_htmlparser { #endif /* __cplusplus */ /* Generated state machine definition. */ diff --git a/src/htmlparser/jsparser.h b/src/htmlparser/jsparser.h index e9a45f9..6987cb4 100644 --- a/src/htmlparser/jsparser.h +++ b/src/htmlparser/jsparser.h @@ -38,7 +38,7 @@ #include "htmlparser/statemachine.h" #ifdef __cplusplus -namespace HTMLPARSER_NAMESPACE { +namespace ctemplate_htmlparser { #endif /* __cplusplus */ /* Size of the ring buffer used to lookup the last token in the javascript diff --git a/src/htmlparser/statemachine.cc b/src/htmlparser/statemachine.cc index 64d27b3..00fbe26 100644 --- a/src/htmlparser/statemachine.cc +++ b/src/htmlparser/statemachine.cc @@ -48,7 +48,7 @@ #endif #ifdef __cplusplus -namespace HTMLPARSER_NAMESPACE { +namespace ctemplate_htmlparser { #endif #define MAX_CHAR_8BIT 256 diff --git a/src/htmlparser/statemachine.h b/src/htmlparser/statemachine.h index 201c9fa..2784604 100644 --- a/src/htmlparser/statemachine.h +++ b/src/htmlparser/statemachine.h @@ -36,7 +36,7 @@ #include #ifdef __cplusplus -namespace HTMLPARSER_NAMESPACE { +namespace ctemplate_htmlparser { #endif /* TODO(falmeida): I'm not sure about these limits, but since right now we only diff --git a/src/template.cc b/src/template.cc index ff54699..de20d06 100644 --- a/src/template.cc +++ b/src/template.cc @@ -116,7 +116,7 @@ using HASH_NAMESPACE::hash_map; namespace ctemplate { -using HTMLPARSER_NAMESPACE::HtmlParser; +using ctemplate_htmlparser::HtmlParser; TemplateId GlobalIdForSTS_INIT(const TemplateString& s) { return s.GetGlobalId(); // normally this method is private diff --git a/src/template_modifiers.cc b/src/template_modifiers.cc index 5151376..4e35281 100644 --- a/src/template_modifiers.cc +++ b/src/template_modifiers.cc @@ -84,7 +84,7 @@ bool HasInsecureProtocol(const char* in, int inlen) { namespace ctemplate { -using HTMLPARSER_NAMESPACE::HtmlParser; +using ctemplate_htmlparser::HtmlParser; // A most-efficient way to append a string literal to the var named 'out'. // The ""s ensure literal is actually a string literal diff --git a/src/template_modifiers_internal.h b/src/template_modifiers_internal.h index 504edf3..b453e18 100644 --- a/src/template_modifiers_internal.h +++ b/src/template_modifiers_internal.h @@ -65,7 +65,7 @@ using std::string; using std::vector; -namespace HTMLPARSER_NAMESPACE { +namespace ctemplate_htmlparser { class HtmlParser; } @@ -181,7 +181,7 @@ string PrettyPrintOneModifier(const ModifierAndValue& modval); // to change. extern CTEMPLATE_DLL_DECL vector GetModifierForHtmlJs( - HTMLPARSER_NAMESPACE::HtmlParser* htmlparser, string* error_msg); + ctemplate_htmlparser::HtmlParser* htmlparser, string* error_msg); // Returns the appropriate escaping directives to escape content // in a CSS context. @@ -191,7 +191,7 @@ vector GetModifierForHtmlJs( // that take URLs, which require a different escaping function (non-existent). extern CTEMPLATE_DLL_DECL vector GetModifierForCss( - HTMLPARSER_NAMESPACE::HtmlParser* htmlparser, string* error_msg); + ctemplate_htmlparser::HtmlParser* htmlparser, string* error_msg); // Returns the appropriate escaping directives to escape content // in an XML context. @@ -199,7 +199,7 @@ vector GetModifierForCss( // parser nor can it fail. This may change once the parser can parse XML. extern CTEMPLATE_DLL_DECL vector GetModifierForXml( - HTMLPARSER_NAMESPACE::HtmlParser* htmlparser, string* error_msg); + ctemplate_htmlparser::HtmlParser* htmlparser, string* error_msg); // Returns the appropriate escaping directives to escape content // in a JSON context. @@ -208,7 +208,7 @@ vector GetModifierForXml( // and distinguish different contexts within JSON. extern CTEMPLATE_DLL_DECL vector GetModifierForJson( - HTMLPARSER_NAMESPACE::HtmlParser* htmlparser, string* error_msg); + ctemplate_htmlparser::HtmlParser* htmlparser, string* error_msg); // Return the default escaping directives to escape content for the given // context. These methods are useful when the caller does not have diff --git a/src/tests/htmlparser_cpp_test.cc b/src/tests/htmlparser_cpp_test.cc index c0f71b5..a8bcf79 100644 --- a/src/tests/htmlparser_cpp_test.cc +++ b/src/tests/htmlparser_cpp_test.cc @@ -88,7 +88,7 @@ using std::string; using std::vector; using GOOGLE_NAMESPACE::PathJoin; -namespace HTMLPARSER_NAMESPACE { +namespace ctemplate_htmlparser { // Maximum file size limit. static const int kMaxFileSize = 1000000;