8 #ifndef CPPCMS_FILTERS_H 9 #define CPPCMS_FILTERS_H 16 #include <cppcms/defs.h> 17 #include <booster/copy_ptr.h> 18 #include <booster/hold_ptr.h> 19 #include <booster/noncopyable.h> 20 #include <cppcms/localization.h> 32 static int domain_id(std::ostream &out,std::string
const &
domain);
47 void set_and_save(
int id);
50 std::ostream *output_;
70 typedef void (*to_stream_type)(std::ostream &,
void const *ptr);
71 typedef std::string (*to_string_type)(std::ios &,
void const *ptr);
76 streamable(streamable
const &other);
77 streamable
const &operator=(streamable
const &other);
86 to_stream_type s1=&to_stream<S>;
87 to_string_type s2=&to_string<S>;
88 std::type_info
const *info=&
typeid(S);
99 if(
typeid(T) != type())
100 throw std::bad_cast();
101 T
const *
object=
reinterpret_cast<T
const *
>(ptr_);
108 streamable(
char const *ptr);
114 void operator()(std::ostream &output)
const;
119 std::string
get(std::ios &ios)
const;
121 void set(
void const *ptr,to_stream_type f1,to_string_type f2,std::type_info
const *type);
124 static void to_stream(std::ostream &out,
void const *ptr)
126 T
const *
object=
reinterpret_cast<T
const *
>(ptr);
132 static std::string to_string(std::ios &out,
void const *ptr)
134 T
const *
object=
reinterpret_cast<T
const *
>(ptr);
135 std::ostringstream oss;
141 std::type_info
const &type()
const;
145 to_stream_type to_stream_;
146 to_string_type to_string_;
147 std::type_info
const *type_;
156 CPPCMS_API streamable::streamable(std::string
const &str);
170 void operator()(std::ostream &out)
const;
197 void operator()(std::ostream &out)
const;
224 void operator()(std::ostream &out)
const;
251 void operator()(std::ostream &out)
const;
277 void operator()(std::ostream &out)
const;
305 void operator()(std::ostream &out)
const;
332 void operator()(std::ostream &out)
const;
358 raw const &operator=(
raw const &other);
359 void operator()(std::ostream &out)
const;
371 inline std::ostream &
operator<<(std::ostream &out,
raw const &obj)
384 date const &operator=(
date const &other);
396 void operator()(std::ostream &out)
const;
404 inline std::ostream &
operator<<(std::ostream &out,
date const &obj)
419 time const &operator=(
time const &other);
431 void operator()(std::ostream &out)
const;
439 inline std::ostream &
operator<<(std::ostream &out,
time const &obj)
465 void operator()(std::ostream &out)
const;
504 void operator()(std::ostream &out)
const;
streamable(S const &ptr)
Definition: filters.h:83
Output filter urlencode.
Definition: filters.h:299
std::ios_base & date(std::ios_base &ios)
Definition: formatting.h:319
std::basic_string< CharType > to_lower(std::basic_string< CharType > const &str, std::locale const &loc=std::locale())
Definition: conversion.h:248
Output filter raw.
Definition: filters.h:353
Output filter escape.
Definition: filters.h:271
details::set_domain domain(std::string const &id)
Definition: message.h:789
std::basic_string< CharType > to_title(std::basic_string< CharType > const &str, std::locale const &loc=std::locale())
Definition: conversion.h:286
Output filter to_lower.
Definition: filters.h:191
std::ios_base & datetime(std::ios_base &ios)
Definition: formatting.h:337
std::basic_string< CharType > to_upper(std::basic_string< CharType > const &str, std::locale const &loc=std::locale())
Definition: conversion.h:209
Output filter base64_urlencode.
Definition: filters.h:326
This is the namespace where all CppCMS functionality is placed.
Definition: application.h:19
basic_message< CharType > translate(CharType const *msg)
Translate a message, msg is not copied.
Definition: message.h:530
Formats date to the stream, date is represented as number - POSIX time, a plain number.
Definition: filters.h:380
Format date and time to ouput stream.
Definition: filters.h:449
Output filter to_title.
Definition: filters.h:218
set gettext domain id withing specific scope
Definition: filters.h:27
Custom time formating filter.
Definition: filters.h:483
std::ios_base & strftime(std::ios_base &ios)
Definition: formatting.h:347
Output filter escape.
Definition: filters.h:245
A special proxy object for writing any object to a std::ostream.
Definition: filters.h:67
Output filter to_upper.
Definition: filters.h:164
archive & operator<<(archive &a, Archivable const &object)
Definition: serialization_classes.h:176
Format local time to ouput stream.
Definition: filters.h:415
std::ios_base & time(std::ios_base &ios)
Definition: formatting.h:328
This class makes impossible to copy any class derived from this one.
Definition: noncopyable.h:15