diff --git a/src/windows/ctemplate/find_ptr.h b/src/windows/ctemplate/find_ptr.h index 8e6fec5..8e50e78 100644 --- a/src/windows/ctemplate/find_ptr.h +++ b/src/windows/ctemplate/find_ptr.h @@ -33,6 +33,8 @@ #ifndef TEMPLATE_FIND_PTR_H_ #define TEMPLATE_FIND_PTR_H_ +#include + // NOTE: if you are statically linking the template library into your binary // (rather than using the template .dll), set '/D CTEMPLATE_DLL_DECL=' // as a compiler flag in your project file to turn off the dllimports. @@ -42,6 +44,13 @@ namespace ctemplate { +template +const typename T::value_type* find_ptr0(const T& c, U v) +{ + typename T::const_iterator i = c.find(v); + return i == c.end() ? NULL : &*i; +} + template typename T::value_type::second_type* find_ptr(T& c, U v) { diff --git a/src/windows/ctemplate/template.h b/src/windows/ctemplate/template.h index 4d12cb7..403c322 100644 --- a/src/windows/ctemplate/template.h +++ b/src/windows/ctemplate/template.h @@ -57,7 +57,7 @@ class PerExpandData; } #endif -namespace google_ctemplate_streamhtmlparser { +namespace ctemplate_htmlparser { class HtmlParser; } @@ -324,9 +324,6 @@ class CTEMPLATE_DLL_DECL Template { static bool StringToTemplateCache(const TemplateString& key, const char* content, Strip); - // INSTEAD, use ReloadAllIfChanged. - bool ReloadIfChanged(); - protected: friend class SectionTemplateNode; // for access to set_state(), ParseState friend class TemplateTemplateNode; // for recursive call to Expand() @@ -439,7 +436,7 @@ class CTEMPLATE_DLL_DECL 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). - google_ctemplate_streamhtmlparser::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 @@ -488,5 +485,4 @@ class CTEMPLATE_DLL_DECL Template { } - #endif // CTEMPLATE_TEMPLATE_H_ diff --git a/src/windows/ctemplate/template_annotator.h b/src/windows/ctemplate/template_annotator.h index e7daf6d..e43a880 100644 --- a/src/windows/ctemplate/template_annotator.h +++ b/src/windows/ctemplate/template_annotator.h @@ -138,5 +138,4 @@ class CTEMPLATE_DLL_DECL TextTemplateAnnotator : public TemplateAnnotator { } - #endif // TEMPLATE_TEMPLATE_ANNOTATOR_H_ diff --git a/src/windows/ctemplate/template_dictionary.h b/src/windows/ctemplate/template_dictionary.h index c1f3869..a4a062e 100644 --- a/src/windows/ctemplate/template_dictionary.h +++ b/src/windows/ctemplate/template_dictionary.h @@ -236,10 +236,6 @@ class CTEMPLATE_DLL_DECL TemplateDictionary : public TemplateDictionaryInterface __attribute__((__format__ (__printf__, 4, 5))) #endif ; // starts at 4 because of implicit 1st arg 'this' - void SetEscapedValueAndShowSection(const TemplateString variable, - const TemplateString value, - const TemplateModifier& escfn, - const TemplateString section_name); private: @@ -460,5 +456,4 @@ class CTEMPLATE_DLL_DECL TemplateDictionary : public TemplateDictionaryInterface } - #endif // TEMPLATE_TEMPLATE_DICTIONARY_H_ diff --git a/src/windows/ctemplate/template_dictionary_interface.h b/src/windows/ctemplate/template_dictionary_interface.h index 03bae41..93ae4b1 100644 --- a/src/windows/ctemplate/template_dictionary_interface.h +++ b/src/windows/ctemplate/template_dictionary_interface.h @@ -145,5 +145,4 @@ class CTEMPLATE_DLL_DECL TemplateDictionaryInterface { } - #endif // TEMPLATE_TEMPLATE_DICTIONARY_INTERFACE_H_ diff --git a/src/windows/ctemplate/template_emitter.h b/src/windows/ctemplate/template_emitter.h index 58d038a..f6e9f41 100644 --- a/src/windows/ctemplate/template_emitter.h +++ b/src/windows/ctemplate/template_emitter.h @@ -72,5 +72,4 @@ class CTEMPLATE_DLL_DECL StringEmitter : public ExpandEmitter { } - #endif // TEMPLATE_TEMPLATE_EMITTER_H_ diff --git a/src/windows/ctemplate/template_enums.h b/src/windows/ctemplate/template_enums.h index a240e75..57db6ca 100644 --- a/src/windows/ctemplate/template_enums.h +++ b/src/windows/ctemplate/template_enums.h @@ -43,5 +43,4 @@ enum Strip { DO_NOT_STRIP, STRIP_BLANK_LINES, STRIP_WHITESPACE, } - #endif // TEMPLATE_TEMPLATE_ENUMS_H_ diff --git a/src/windows/ctemplate/template_modifiers.h b/src/windows/ctemplate/template_modifiers.h index b981a60..41d6a81 100644 --- a/src/windows/ctemplate/template_modifiers.h +++ b/src/windows/ctemplate/template_modifiers.h @@ -348,10 +348,8 @@ bool AddModifier(const char* long_name, const TemplateModifier* modifier); // is used in a different context (say Javascript) where this // escaping may be inadequate. extern CTEMPLATE_DLL_DECL -bool AddXssSafeModifier(const char* long_name, - const TemplateModifier* modifier); +bool AddXssSafeModifier(const char* long_name, const TemplateModifier* modifier); } - #endif // TEMPLATE_TEMPLATE_MODIFIERS_H_ diff --git a/src/windows/ctemplate/template_namelist.h b/src/windows/ctemplate/template_namelist.h index 26bd03a..da36a1f 100644 --- a/src/windows/ctemplate/template_namelist.h +++ b/src/windows/ctemplate/template_namelist.h @@ -165,5 +165,4 @@ class CTEMPLATE_DLL_DECL TemplateNamelist { } - #endif // TEMPLATE_TEMPLATE_NAMELIST_H_ diff --git a/src/windows/ctemplate/template_string.h b/src/windows/ctemplate/template_string.h index f1bd38b..bcc226b 100644 --- a/src/windows/ctemplate/template_string.h +++ b/src/windows/ctemplate/template_string.h @@ -342,7 +342,7 @@ class CTEMPLATE_DLL_DECL StaticTemplateStringInitializer { // Don't use this. This is used only in auto-generated .varnames.h files. #define STS_INIT_WITH_HASH(name, str, hash_compare) \ - { { str, sizeof(""str"")-1, hash_compare } }; \ + { { str, sizeof("" str "")-1, hash_compare } }; \ namespace ctemplate_sts_init { \ static const ctemplate::StaticTemplateStringInitializer name##_init(&name); \ } @@ -359,5 +359,4 @@ const StaticTemplateString kStsEmpty = } - #endif // TEMPLATE_TEMPLATE_STRING_H_