mirror of
https://github.com/OlafvdSpek/ctemplate.git
synced 2025-10-05 19:16:54 +08:00
Update Windows files
This commit is contained in:
parent
b890ce2f55
commit
057f80ddfc
|
@ -33,6 +33,8 @@
|
||||||
#ifndef TEMPLATE_FIND_PTR_H_
|
#ifndef TEMPLATE_FIND_PTR_H_
|
||||||
#define TEMPLATE_FIND_PTR_H_
|
#define TEMPLATE_FIND_PTR_H_
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
// NOTE: if you are statically linking the template library into your binary
|
// NOTE: if you are statically linking the template library into your binary
|
||||||
// (rather than using the template .dll), set '/D CTEMPLATE_DLL_DECL='
|
// (rather than using the template .dll), set '/D CTEMPLATE_DLL_DECL='
|
||||||
// as a compiler flag in your project file to turn off the dllimports.
|
// as a compiler flag in your project file to turn off the dllimports.
|
||||||
|
@ -42,6 +44,13 @@
|
||||||
|
|
||||||
namespace ctemplate {
|
namespace ctemplate {
|
||||||
|
|
||||||
|
template <class T, class U>
|
||||||
|
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 <class T, class U>
|
template <class T, class U>
|
||||||
typename T::value_type::second_type* find_ptr(T& c, U v)
|
typename T::value_type::second_type* find_ptr(T& c, U v)
|
||||||
{
|
{
|
||||||
|
|
|
@ -57,7 +57,7 @@ class PerExpandData;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace google_ctemplate_streamhtmlparser {
|
namespace ctemplate_htmlparser {
|
||||||
class HtmlParser;
|
class HtmlParser;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -324,9 +324,6 @@ class CTEMPLATE_DLL_DECL Template {
|
||||||
static bool StringToTemplateCache(const TemplateString& key,
|
static bool StringToTemplateCache(const TemplateString& key,
|
||||||
const char* content, Strip);
|
const char* content, Strip);
|
||||||
|
|
||||||
// INSTEAD, use ReloadAllIfChanged.
|
|
||||||
bool ReloadIfChanged();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
friend class SectionTemplateNode; // for access to set_state(), ParseState
|
friend class SectionTemplateNode; // for access to set_state(), ParseState
|
||||||
friend class TemplateTemplateNode; // for recursive call to Expand()
|
friend class TemplateTemplateNode; // for recursive call to Expand()
|
||||||
|
@ -439,7 +436,7 @@ class CTEMPLATE_DLL_DECL Template {
|
||||||
TemplateContext initial_context_;
|
TemplateContext initial_context_;
|
||||||
// Non-null if the template was initialized in an Auto-Escape mode that
|
// Non-null if the template was initialized in an Auto-Escape mode that
|
||||||
// requires a parser (currently TC_HTML, TC_CSS and TC_JS).
|
// 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
|
// A sorted list of trusted variable names, declared here because a unittest
|
||||||
// needs to verify that it is appropriately sorted (an unsorted array would
|
// 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_
|
#endif // CTEMPLATE_TEMPLATE_H_
|
||||||
|
|
|
@ -138,5 +138,4 @@ class CTEMPLATE_DLL_DECL TextTemplateAnnotator : public TemplateAnnotator {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // TEMPLATE_TEMPLATE_ANNOTATOR_H_
|
#endif // TEMPLATE_TEMPLATE_ANNOTATOR_H_
|
||||||
|
|
|
@ -236,10 +236,6 @@ class CTEMPLATE_DLL_DECL TemplateDictionary : public TemplateDictionaryInterface
|
||||||
__attribute__((__format__ (__printf__, 4, 5)))
|
__attribute__((__format__ (__printf__, 4, 5)))
|
||||||
#endif
|
#endif
|
||||||
; // starts at 4 because of implicit 1st arg 'this'
|
; // 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:
|
private:
|
||||||
|
@ -460,5 +456,4 @@ class CTEMPLATE_DLL_DECL TemplateDictionary : public TemplateDictionaryInterface
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // TEMPLATE_TEMPLATE_DICTIONARY_H_
|
#endif // TEMPLATE_TEMPLATE_DICTIONARY_H_
|
||||||
|
|
|
@ -145,5 +145,4 @@ class CTEMPLATE_DLL_DECL TemplateDictionaryInterface {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // TEMPLATE_TEMPLATE_DICTIONARY_INTERFACE_H_
|
#endif // TEMPLATE_TEMPLATE_DICTIONARY_INTERFACE_H_
|
||||||
|
|
|
@ -72,5 +72,4 @@ class CTEMPLATE_DLL_DECL StringEmitter : public ExpandEmitter {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // TEMPLATE_TEMPLATE_EMITTER_H_
|
#endif // TEMPLATE_TEMPLATE_EMITTER_H_
|
||||||
|
|
|
@ -43,5 +43,4 @@ enum Strip { DO_NOT_STRIP, STRIP_BLANK_LINES, STRIP_WHITESPACE,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // TEMPLATE_TEMPLATE_ENUMS_H_
|
#endif // TEMPLATE_TEMPLATE_ENUMS_H_
|
||||||
|
|
|
@ -348,10 +348,8 @@ bool AddModifier(const char* long_name, const TemplateModifier* modifier);
|
||||||
// is used in a different context (say Javascript) where this
|
// is used in a different context (say Javascript) where this
|
||||||
// escaping may be inadequate.
|
// escaping may be inadequate.
|
||||||
extern CTEMPLATE_DLL_DECL
|
extern CTEMPLATE_DLL_DECL
|
||||||
bool AddXssSafeModifier(const char* long_name,
|
bool AddXssSafeModifier(const char* long_name, const TemplateModifier* modifier);
|
||||||
const TemplateModifier* modifier);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // TEMPLATE_TEMPLATE_MODIFIERS_H_
|
#endif // TEMPLATE_TEMPLATE_MODIFIERS_H_
|
||||||
|
|
|
@ -165,5 +165,4 @@ class CTEMPLATE_DLL_DECL TemplateNamelist {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // TEMPLATE_TEMPLATE_NAMELIST_H_
|
#endif // TEMPLATE_TEMPLATE_NAMELIST_H_
|
||||||
|
|
|
@ -342,7 +342,7 @@ class CTEMPLATE_DLL_DECL StaticTemplateStringInitializer {
|
||||||
|
|
||||||
// Don't use this. This is used only in auto-generated .varnames.h files.
|
// Don't use this. This is used only in auto-generated .varnames.h files.
|
||||||
#define STS_INIT_WITH_HASH(name, str, hash_compare) \
|
#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 { \
|
namespace ctemplate_sts_init { \
|
||||||
static const ctemplate::StaticTemplateStringInitializer name##_init(&name); \
|
static const ctemplate::StaticTemplateStringInitializer name##_init(&name); \
|
||||||
}
|
}
|
||||||
|
@ -359,5 +359,4 @@ const StaticTemplateString kStsEmpty =
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // TEMPLATE_TEMPLATE_STRING_H_
|
#endif // TEMPLATE_TEMPLATE_STRING_H_
|
||||||
|
|
Loading…
Reference in New Issue
Block a user