forked from CopernicaMarketingSoftware/PHP-CPP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
streams.h
34 lines (30 loc) · 926 Bytes
/
streams.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
* Streams.h
*
* Just like the standard std::cout and std::cerr objects to output data, you
* can use similar stream objects for outputting data to PHP. Php::out is the
* C++ equivalent of the PHP echo() function, and Php::err() is the C++ stream
* that behaves like calling trigger_error() from PHP.
*
* Php::out << "this is example text" << std::endl;
* Php::err << "this is an error message" << std::endl;
*
* @author Emiel Bruijntjes <emiel.bruijntjes@copernica.com>
* @copyright 2014 Copernica BV
*/
/**
* Set up namespace
*/
namespace Php {
/**
* Define the out and err objects
*/
extern thread_local PHPCPP_EXPORT std::ostream out;
extern thread_local PHPCPP_EXPORT std::ostream error;
extern thread_local PHPCPP_EXPORT std::ostream notice;
extern thread_local PHPCPP_EXPORT std::ostream warning;
extern thread_local PHPCPP_EXPORT std::ostream deprecated;
/**
* End namespace
*/
}