@@ -139,6 +139,7 @@ namespace aio { | |||
/// | |||
/// Throws system::system_error if error occurs. | |||
/// | |||
/// \ver{v1_2} | |||
void set_non_blocking_if_needed(bool nonblocking); | |||
/// | |||
/// Set the object to blocking or non-blocking mode. It checks if set_non_blocking() was | |||
@@ -146,6 +147,7 @@ namespace aio { | |||
/// | |||
/// If a error occurs it is assigned to \a e. | |||
/// | |||
/// \ver{v1_2} | |||
void set_non_blocking_if_needed(bool nonblocking,system::error_code &e); | |||
/// | |||
@@ -111,12 +111,14 @@ namespace aio { | |||
/// | |||
/// Throws system::system_error if error occurs. | |||
/// | |||
/// \ver{v1_2} | |||
void bind(endpoint const &ep); | |||
/// | |||
/// Bind the opended socket the \ref endpoint \a ep | |||
/// | |||
/// If a error occurs it is assigned to \a e. | |||
/// | |||
/// \ver{v1_2} | |||
void bind(endpoint const &ep,system::error_code &e); | |||
/// | |||
/// Starts listening on the socket with backlog parameter \a backlog | |||
@@ -88,6 +88,7 @@ namespace booster { | |||
/// | |||
/// Get size of buffer in number of chunks,i.e. | |||
/// | |||
/// \ver{v1_2} | |||
size_t size() const | |||
{ | |||
return size_; | |||
@@ -95,6 +96,7 @@ namespace booster { | |||
/// | |||
/// Get total amount of bytes in the buffer | |||
/// | |||
/// \ver{v1_2} | |||
size_t bytes_count() const | |||
{ | |||
if(size_ == 0) | |||
@@ -120,10 +120,12 @@ namespace aio { | |||
/// | |||
/// Post event completion hander with its status | |||
/// | |||
/// \ver{v1_2} | |||
void post(event_handler const &h,booster::system::error_code const &e); | |||
/// | |||
/// Post event i/o completion hander with its status and i/o size | |||
/// | |||
/// \ver{v1_2} | |||
void post(io_handler const &h,booster::system::error_code const &e,size_t n); | |||
@@ -196,11 +196,13 @@ namespace aio { | |||
/// | |||
/// Return a number of avalible bytes to read, if error occurs returns 0 and e set to the error code | |||
/// | |||
/// \ver{v1_2} | |||
size_t bytes_readable(booster::system::error_code &e); | |||
/// | |||
/// Return a number of avalible bytes to read, if error occurs system_error is thrown | |||
/// | |||
/// \ver{v1_2} | |||
size_t bytes_readable(); | |||
private: | |||
@@ -56,6 +56,11 @@ namespace booster { | |||
{ | |||
public: | |||
/// | |||
/// Pointer to callable object | |||
/// | |||
/// \ver{v1_2} | |||
typedef intrusive_ptr<callable_type> pointer_type; | |||
/// | |||
/// Type of result, for use with boost::bind | |||
/// | |||
typedef Result result_type; | |||
@@ -104,6 +109,16 @@ namespace booster { | |||
/// Swaps two callbackal object. Does not throw. | |||
/// | |||
void swap(callback &other); | |||
/// | |||
/// Get underlying pointer to callable_type | |||
/// | |||
/// \ver{v1_2} | |||
pointer_type const &get_pointer() const; | |||
/// | |||
/// Get underlying pointer to callable_type | |||
/// | |||
/// \ver{v1_2} | |||
pointer_type &get_pointer(); | |||
}; | |||
#else | |||
@@ -258,6 +258,7 @@ namespace log { | |||
/// | |||
/// \note \a s should be valid as long as the object exists | |||
/// | |||
/// \ver{v1_2} | |||
class BOOSTER_API stream : public sink { | |||
public: | |||
/// | |||
@@ -285,6 +286,7 @@ namespace log { | |||
/// Flag that can be passed to constructor that specifies that | |||
/// the log should be appended to the existing file | |||
/// | |||
/// \ver{v1_2} | |||
static const int app = -1; | |||
/// | |||
@@ -297,6 +299,7 @@ namespace log { | |||
/// then no new files created but rather the log is appended to the | |||
/// existing file | |||
/// | |||
/// \ver{v1_2} | |||
file(std::string const &file_name,int max_files = 0); | |||
virtual ~file(); | |||
@@ -200,6 +200,7 @@ namespace booster { | |||
/// | |||
/// Add two POSIX time ranges (as numbers) | |||
/// | |||
/// \ver{v1_2} | |||
ptime& operator+=(ptime const &other) | |||
{ | |||
*this = ptime(sec+other.sec,nsec+other.nsec); | |||
@@ -217,6 +218,7 @@ namespace booster { | |||
/// | |||
/// Subtract one time from other (as number) | |||
/// | |||
/// \ver{v1_2} | |||
ptime& operator-=(ptime const &other) | |||
{ | |||
*this = ptime(sec-other.sec,nsec-other.nsec); | |||
@@ -277,11 +277,13 @@ namespace cppcms { | |||
/// Add context to applications such that context ownership isn't transferred | |||
/// to the application | |||
/// | |||
/// \ver{v1_2} | |||
void add_context(http::context &conn); | |||
/// | |||
/// Remove context added with add_context | |||
/// | |||
/// \ver{v1_2} | |||
void remove_context(); | |||
/// | |||
@@ -42,13 +42,14 @@ namespace cppcms { | |||
} | |||
/// | |||
/// Flags for application pool management | |||
/// \brief Flags for application pool management | |||
/// | |||
/// \ver{v1_2} | |||
namespace app { | |||
static const int synchronous = 0x0000; ///< Synchronous application | |||
static const int asynchronous = 0x0001; ///< Asynchronous application that operates in asynchronous mode | |||
static const int op_mode_mask = 0x000F; /// mask to select sync vs async flags | |||
static const int op_mode_mask = 0x000F; ///< mask to select sync vs async flags | |||
static const int thread_specific= 0x0010; ///< Make synchronous application thread specific | |||
static const int prepopulated = 0x0020; ///< Make sure all applications are created from the beginning (ignored in thread_specific is set) | |||
@@ -61,6 +62,7 @@ namespace cppcms { | |||
/// | |||
/// \brief an interface for creating user applications | |||
/// | |||
/// \ver{v1_2} | |||
class CPPCMS_API application_specific_pool : | |||
public booster::noncopyable, | |||
public booster::enable_shared_from_this<application_specific_pool> | |||
@@ -206,6 +208,7 @@ namespace cppcms { | |||
/// | |||
/// This member function is thread safe. | |||
/// | |||
/// \ver{v1_2} | |||
void mount(booster::shared_ptr<application_specific_pool> gen,int application_options = 0); | |||
/// | |||
@@ -218,6 +221,7 @@ namespace cppcms { | |||
/// | |||
/// This member function is thread safe. | |||
/// | |||
/// \ver{v1_2} | |||
void mount(booster::shared_ptr<application_specific_pool> gen,mount_point const &point,int application_options = 0); | |||
@@ -232,6 +236,7 @@ namespace cppcms { | |||
/// | |||
/// This member function is thread safe. | |||
/// | |||
/// \ver{v1_2} | |||
void unmount(booster::weak_ptr<application_specific_pool> gen); | |||
@@ -144,6 +144,7 @@ namespace cppcms { | |||
/// fetch_page and store_page would work, it is not possible to | |||
/// handle pages without full i/o context | |||
/// | |||
/// \ver{v1_2} | |||
cache_interface(cppcms::service &srv); | |||
/// | |||
/// \cond INTERNAL | |||
@@ -537,11 +537,13 @@ namespace cppcms { | |||
/// | |||
/// Get the HTML \c readonly attribute. | |||
/// | |||
/// \ver{v1_2} | |||
bool readonly(); | |||
/// | |||
/// Set/Unset the HTML \c readonly attribute. | |||
/// | |||
/// \ver{v1_2} | |||
void readonly(bool); | |||
/// | |||
@@ -27,6 +27,7 @@ namespace http { | |||
/// | |||
/// Exceptions that is thrown to abort content upload progress indicating an error | |||
/// | |||
/// \ver{v1_2} | |||
class CPPCMS_API abort_upload : public cppcms_error { | |||
public: | |||
/// | |||
@@ -47,6 +48,7 @@ namespace http { | |||
/// | |||
/// Class that represent the limits on the input content sizes | |||
/// | |||
/// \ver{v1_2} | |||
class CPPCMS_API content_limits : public booster::noncopyable { | |||
friend class request; | |||
public: | |||
@@ -121,6 +123,7 @@ namespace http { | |||
/// Note that when `on_*` member functions of the basic_content_filter are called the original application that runs the filtering | |||
/// has temporary installed context that can be accessed from it. | |||
/// | |||
/// \ver{v1_2} | |||
class CPPCMS_API basic_content_filter { | |||
basic_content_filter(basic_content_filter const &); | |||
void operator=(basic_content_filter const &); | |||
@@ -150,6 +153,7 @@ namespace http { | |||
/// Note: when raw_content_filter is used no content data is actually saved to request, for example request().raw_post_data() would return | |||
/// an empty content, so it is your responsibility to store/parse whatever content you use | |||
/// | |||
/// \ver{v1_2} | |||
class CPPCMS_API raw_content_filter : public basic_content_filter { | |||
public: | |||
/// | |||
@@ -174,6 +178,7 @@ namespace http { | |||
/// It allows to process/validate incomping data on the fly and make sure that for example the user is actually authorized to upload | |||
/// such a files | |||
/// | |||
/// \ver{v1_2} | |||
class CPPCMS_API multipart_filter : public basic_content_filter { | |||
public: | |||
multipart_filter(); | |||
@@ -56,10 +56,12 @@ public: | |||
/// | |||
/// Check if media type application/x-www-form-urlencoded content_type | |||
/// | |||
/// \ver{v1_2} | |||
bool is_form_urlencoded() const; | |||
/// | |||
/// Check if media type is multipart/form-data content_type | |||
/// | |||
/// \ver{v1_2} | |||
bool is_multipart_form_data() const; | |||
/// | |||
@@ -176,6 +176,7 @@ namespace cppcms { | |||
/// | |||
/// This function can be called from any thread | |||
/// | |||
/// \ver{v1_2} | |||
void submit_to_pool(booster::shared_ptr<application_specific_pool> pool,std::string const &matched_url); | |||
/// | |||
/// Submit the context to alternative application - allows to transfer context from application to application, \a matched_url | |||
@@ -189,6 +190,7 @@ namespace cppcms { | |||
/// | |||
/// This function can be called from any thread | |||
/// | |||
/// \ver{v1_2} | |||
void submit_to_asynchronous_application(booster::intrusive_ptr<application> app,std::string const &matched_url); | |||
private: | |||
@@ -204,6 +206,7 @@ namespace cppcms { | |||
/// Get context specific value of type T binded to context. If none is stored or | |||
/// type mismatched NULL is returned | |||
/// | |||
/// \ver{v1_2} | |||
template<typename T> | |||
T *get_specific() | |||
{ | |||
@@ -215,6 +218,7 @@ namespace cppcms { | |||
/// | |||
/// Reset context specific value of type T binded to context. Old value is deleted | |||
/// | |||
/// \ver{v1_2} | |||
template<typename T> | |||
void reset_specific(T *ptr = 0) | |||
{ | |||
@@ -234,6 +238,7 @@ namespace cppcms { | |||
/// | |||
/// Release context specific value binded to context. | |||
/// | |||
/// \ver{v1_2} | |||
template<typename T> | |||
T *release_specific() | |||
{ | |||
@@ -85,12 +85,14 @@ public: | |||
/// | |||
/// Returns expires timestamp for the cookie, if not set returns 0 | |||
/// | |||
/// \ver{v1_2} | |||
time_t expires() const; | |||
/// | |||
/// returns true if expires(time_t when) was called and expiration was set, | |||
/// if browser_age() is called it is reset to false | |||
/// | |||
/// \ver{v1_2} | |||
bool expires_defined() const; | |||
/// | |||
/// Set max cookie's age | |||
@@ -99,11 +101,13 @@ public: | |||
/// | |||
/// Get max cookie's age, returns 0 if not set | |||
/// | |||
/// \ver{v1_2} | |||
unsigned max_age() const; | |||
/// | |||
/// returns true if max(unsigned age) was called and max_age was set, | |||
/// if browser_age() is called it is reset to false | |||
/// | |||
/// \ver{v1_2} | |||
bool max_age_defined() const; | |||
/// | |||
/// Set age according to browser's session (i.e. no Max-Age) | |||
@@ -48,6 +48,7 @@ namespace http { | |||
/// | |||
/// Returns true if content type defined | |||
/// | |||
/// \ver{v1_2} | |||
bool has_mime() const; | |||
/// | |||
/// Get the filename as it was sent by the browser. | |||
@@ -70,11 +71,13 @@ namespace http { | |||
/// than the file would be deleted on cppcms::http::file destruction, | |||
/// unless save_to is called, otherwise it would remain persistent | |||
/// | |||
/// \ver{v1_2} | |||
void output_file(std::string const &name,bool is_temporary = false); | |||
/// | |||
/// Make sure that file created by output_file member function is not removed in destructor | |||
/// | |||
/// \ver{v1_2} | |||
void make_permanent(); | |||
/// | |||
/// Close the file if it is still open, if the file temporary it is deleted, the the | |||
@@ -82,6 +85,7 @@ namespace http { | |||
/// | |||
/// Returns 0 in case of sucess and -1 in case of failure | |||
/// | |||
/// \ver{v1_2} | |||
int close(); | |||
/// | |||
@@ -110,10 +114,12 @@ namespace http { | |||
/// | |||
/// Set the maximal size of file that would be stored in memory instead of file system | |||
/// | |||
/// \ver{v1_2} | |||
void set_memory_limit(size_t size); | |||
/// | |||
/// Set the temporary directory where uploaded files are created | |||
/// | |||
/// \ver{v1_2} | |||
void set_temporary_directory(std::string const &dir); | |||
@@ -296,35 +296,42 @@ namespace http { | |||
/// | |||
/// Get content limits for incoming data processing | |||
/// | |||
/// \ver{v1_2} | |||
content_limits &limits(); | |||
/// | |||
/// Get installed content filter, returns 0 if it is not installed, no ownership is transfered | |||
/// | |||
/// \ver{v1_2} | |||
basic_content_filter *content_filter(); | |||
/// | |||
/// Installs content filter. If another filter installed it is removed | |||
/// | |||
/// \ver{v1_2} | |||
void set_content_filter(basic_content_filter &flt); | |||
/// | |||
/// Installs new content filter (or removes existing), the ownership of new filter is transfered to the request object | |||
/// | |||
/// \ver{v1_2} | |||
void reset_content_filter(basic_content_filter *flt = 0); | |||
/// | |||
/// Release existing content filter owned by request | |||
/// | |||
/// \ver{v1_2} | |||
basic_content_filter *release_content_filter(); | |||
/// | |||
/// Returns true when full request content is ready | |||
/// | |||
/// \ver{v1_2} | |||
bool is_ready(); | |||
/// | |||
/// Set the size of the buffer for content that isn't loaded to memory directly, | |||
/// like for example multipart/form-data, default is defined in configuration as | |||
/// service.input_buffer_size and defaults to 65536 | |||
/// | |||
/// \ver{v1_2} | |||
void setbuf(int size); | |||
public: | |||
/// \cond INTERNAL | |||
@@ -234,6 +234,7 @@ namespace http { | |||
/// add header - independently of set_header/get_header/erase_header - allows | |||
/// to specify multiple headers of same type like Set-Cookie or WWW-Authenticate | |||
/// | |||
/// \ver{v1_2} | |||
void add_header(std::string const &name,std::string const &value); | |||
/// | |||
@@ -324,6 +325,7 @@ namespace http { | |||
/// | |||
/// Note: when gzip compression active, buffering is still present at intermediate levels | |||
/// | |||
/// \ver{v1_2} | |||
void setbuf(int buffer_size); | |||
/// | |||
/// Sets full buffering mode for asynchronous applications | |||
@@ -336,11 +338,13 @@ namespace http { | |||
/// | |||
/// When the full buffering is disable, if an error occurs, the out() is set to fail state. | |||
/// | |||
/// \ver{v1_2} | |||
void full_asynchronous_buffering(bool enable); | |||
/// | |||
/// Get current state of asynchronous buffering | |||
/// | |||
/// \ver{v1_2} | |||
bool full_asynchronous_buffering(); | |||
/// | |||
@@ -350,6 +354,7 @@ namespace http { | |||
/// | |||
/// Once the condition occurs you can flush the output asynchronously using async_complete_response or async_flush_output | |||
/// | |||
/// \ver{v1_2} | |||
bool pending_blocked_output(); | |||
@@ -496,6 +496,7 @@ namespace json { | |||
/// \param line_number return a number of the line where syntax error occurred | |||
/// \result returns true if the value was read successfully, otherwise returns false to indicate a syntax error. | |||
/// | |||
/// \ver{v1_2} | |||
bool load(char const *&begin,char const *end,bool full,int *line_number=0); | |||
/// | |||
@@ -579,21 +580,25 @@ namespace json { | |||
/// Convert UTF-8 string to JSON string, i.e. a sring foo is converted to "foo", | |||
/// a string bar"baz is converted to "bar\"baz" | |||
/// | |||
/// \ver{v1_2} | |||
std::string CPPCMS_API to_json(std::string const &utf); | |||
/// | |||
/// Convert UTF-8 string to JSON string, i.e. a sring foo is converted to "foo", | |||
/// a string bar"baz is converted to "bar\"baz" | |||
/// | |||
/// \ver{v1_2} | |||
std::string CPPCMS_API to_json(char const *begin,char const *end); | |||
/// | |||
/// Convert UTF-8 string to JSON string, i.e. a sring foo is converted to "foo", | |||
/// a string bar"baz is converted to "bar\"baz" | |||
/// | |||
/// \ver{v1_2} | |||
void CPPCMS_API to_json(char const *begin,char const *end,std::ostream &out); | |||
// | |||
/// Convert UTF-8 string to JSON string, i.e. a sring foo is converted to "foo", | |||
/// a string bar"baz is converted to "bar\"baz" | |||
/// | |||
/// \ver{v1_2} | |||
void CPPCMS_API to_json(std::string const &str,std::ostream &out); | |||
@@ -62,6 +62,7 @@ public: | |||
/// systems, etc. Note incorrect use of non-cookies medium may expose you | |||
/// to security issues | |||
/// | |||
/// \ver{v1_2} | |||
class CPPCMS_API session_interface_cookie_adapter : public booster::noncopyable { | |||
public: | |||
virtual ~session_interface_cookie_adapter(); | |||
@@ -107,6 +108,7 @@ public: | |||
/// Create cppcms::service independent session interface to be used | |||
/// for implementing interoperability with non-cppcms based web platforms | |||
/// | |||
/// \ver{v1_2} | |||
session_interface(session_pool &pool,session_interface_cookie_adapter &adapter); | |||
/// | |||
@@ -318,6 +320,7 @@ public: | |||
/// | |||
/// It can be used for use of an alternative session state medium | |||
/// | |||
/// \ver{v1_2} | |||
bool set_cookie_adapter_and_reload(session_interface_cookie_adapter &adapter); | |||
/// | |||
@@ -391,11 +394,13 @@ public: | |||
/// | |||
/// Get the session cookie name | |||
/// | |||
/// \ver{v1_2} | |||
std::string session_cookie_name(); | |||
/// | |||
/// Retrun a set of keys that are defined for a current session; | |||
/// | |||
/// \ver{v1_2} | |||
std::set<std::string> key_set(); | |||
private: | |||
friend class http::response; | |||
@@ -41,6 +41,7 @@ namespace cppcms { | |||
/// | |||
/// Constructor that is used to create independent pool to access the session storage by external tools | |||
/// | |||
/// \ver{v1_2} | |||
session_pool(json::value const &v); | |||
/// | |||
@@ -53,11 +54,13 @@ namespace cppcms { | |||
/// | |||
/// Note: it allows to install custom session_api, encryptor or storage functionality | |||
/// | |||
/// \ver{v1_2} | |||
void init(); | |||
/// | |||
/// Get an actual object that is used to store/retreive session data | |||
/// | |||
/// \ver{v1_2} | |||
booster::shared_ptr<session_api> get(); | |||
/// | |||
@@ -99,12 +99,14 @@ namespace cppcms { | |||
/// this pattern requested, \a handler is called with 1st, 2nd, 3rd, 4th and 5th parameters | |||
/// the string that was matched at position \a exp1, \a exp2, \a exp3, \a exp4 and \a exp5 | |||
/// | |||
/// \ver{v1_2} | |||
void assign(std::string const ®ex,handler5 handler,int exp1,int exp2,int exp3,int exp4,int exp5); | |||
/// | |||
/// Assign \a handler to pattern \a regex thus if URL that matches | |||
/// this pattern requested, \a handler is called with 1st, 2nd, 3rd, 4th, 5th and 6th parameters | |||
/// the string that was matched at position \a exp1, \a exp2, \a exp3, \a exp4, \a exp 5 and \a exp6 | |||
/// | |||
/// \ver{v1_2} | |||
void assign(std::string const ®ex,handler6 handler,int exp1,int exp2,int exp3,int exp4,int exp5,int exp6); | |||
/// | |||
@@ -139,6 +141,7 @@ namespace cppcms { | |||
/// In addition to calling \a member function it calls object->init() before call | |||
/// and object->clean() after the call of the C is derived from cppcms::application | |||
/// | |||
/// \ver{v1_2} | |||
template<typename C> | |||
void assign_generic(std::string const ®ex,void (C::*member)(booster::cmatch const &),C *object) | |||
{ | |||
@@ -199,6 +202,7 @@ namespace cppcms { | |||
/// In addition to calling \a member function it calls object->init() before call | |||
/// and object->clean() after the call of the C is derived from cppcms::application | |||
/// | |||
/// \ver{v1_2} | |||
template<typename C> | |||
void assign(std::string const ®ex,void (C::*member)(std::string,std::string,std::string,std::string,std::string),C *object,int e1,int e2,int e3,int e4,int e5) | |||
{ | |||
@@ -211,6 +215,7 @@ namespace cppcms { | |||
/// In addition to calling \a member function it calls object->init() before call | |||
/// and object->clean() after the call of the C is derived from cppcms::application | |||
/// | |||
/// \ver{v1_2} | |||
template<typename C> | |||
void assign(std::string const ®ex,void (C::*member)(std::string,std::string,std::string,std::string,std::string,std::string),C *object,int e1,int e2,int e3,int e4,int e5,int e6) | |||
{ | |||
@@ -155,6 +155,7 @@ namespace cppcms { | |||
/// | |||
/// This function is thread safe | |||
/// | |||
/// \ver{v1_2} | |||
std::vector<std::string> enumerate(); | |||
/// | |||
@@ -27,4 +27,9 @@ You can find multiple tutorails at the <a href="http://cppcms.com">cppcms.com</a | |||
Multiple examples of using CppCMS can be found at this page \subpage examples_page | |||
\defgroup v1_2 New in CppCMS 1.2 | |||
\page new_api New API by Version | |||
- \ref v1_2 | |||
*/ |