File tree Expand file tree Collapse file tree 5 files changed +17
-1
lines changed Expand file tree Collapse file tree 5 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,10 @@ namespace boost { namespace network {
49
49
std::string & body () const {
50
50
return _body;
51
51
};
52
+
53
+ std::string & source () const {
54
+ return _source;
55
+ };
52
56
53
57
private:
54
58
@@ -57,6 +61,7 @@ namespace boost { namespace network {
57
61
58
62
mutable headers_container_type _headers;
59
63
mutable std::string _body;
64
+ mutable std::string _source;
60
65
};
61
66
62
67
typedef basic_message<> message; // default message type
Original file line number Diff line number Diff line change 12
12
13
13
#include < boost/network/message/directives/header.hpp>
14
14
#include < boost/network/message/directives/body.hpp>
15
+ #include < boost/network/message/directives/source.hpp>
15
16
16
17
namespace boost { namespace network {
17
18
Original file line number Diff line number Diff line change 13
13
*/
14
14
#include < boost/network/message/wrappers/headers.hpp>
15
15
#include < boost/network/message/wrappers/body.hpp>
16
+ #include < boost/network/message/wrappers/source.hpp>
16
17
17
18
#endif // __NETWORK_MESSAGE_WRAPPERS_HPP__
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ project network_test :
8
8
requirements
9
9
<include>../../../
10
10
<source>/boost//unit_test_framework
11
+ <link>static
11
12
;
12
13
13
14
unit-test message_test : message_test.cpp ;
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ BOOST_AUTO_TEST_CASE(header_directives_test) {
29
29
message msg;
30
30
msg << header (" SOME_HEADER" , " SOME_CONTENT" ) ;
31
31
32
- BOOST_CHECK_EQUAL ( headers (msg).count (" SOME_HEADER" ) , 1 );
32
+ BOOST_CHECK_EQUAL ( headers (msg).count (" SOME_HEADER" ) , ( size_t ) 1 );
33
33
headers_range<message>::type range = headers (msg)[" SOME_HEADER" ];
34
34
BOOST_CHECK ( range.first != range.second );
35
35
}
@@ -41,3 +41,11 @@ BOOST_AUTO_TEST_CASE(body_directive_test) {
41
41
42
42
BOOST_CHECK_EQUAL ( body (msg), " The quick brown fox jumps over the lazy dog." );
43
43
}
44
+
45
+ BOOST_AUTO_TEST_CASE (source_directive_test) {
46
+ using namespace boost ::network;
47
+ message msg;
48
+ msg << source (" Somewhere Out There" ) ;
49
+
50
+ BOOST_CHECK_EQUAL ( source (msg), " Somewhere Out There" );
51
+ }
You can’t perform that action at this time.
0 commit comments