]> Dogcows Code - chaz/yoink/blob - src/stlplus/strings/string_smart_ptr.tpp
build system enhancements
[chaz/yoink] / src / stlplus / strings / string_smart_ptr.tpp
1 ////////////////////////////////////////////////////////////////////////////////
2
3 // Author: Andy Rushton
4 // Copyright: (c) Southampton University 1999-2004
5 // (c) Andy Rushton 2004-2009
6 // License: BSD License, see ../docs/license.html
7
8 ////////////////////////////////////////////////////////////////////////////////
9
10 namespace stlplus
11 {
12
13 template<typename T, typename S>
14 std::string smart_ptr_to_string(const smart_ptr<T>& value,
15 S to_string_fn,
16 const std::string& null_string,
17 const std::string& prefix,
18 const std::string& suffix)
19 {
20 return value ? (prefix + to_string_fn(*value) + suffix) : null_string;
21 }
22
23 template<typename T, typename S>
24 std::string smart_ptr_clone_to_string(const smart_ptr_clone<T>& value,
25 S to_string_fn,
26 const std::string& null_string,
27 const std::string& prefix,
28 const std::string& suffix)
29 {
30 return value ? (prefix + to_string_fn(*value) + suffix) : null_string;
31 }
32
33 template<typename T, typename S>
34 std::string smart_ptr_nocopy_to_string(const smart_ptr_nocopy<T>& value,
35 S to_string_fn,
36 const std::string& null_string,
37 const std::string& prefix,
38 const std::string& suffix)
39 {
40 return value ? (prefix + to_string_fn(*value) + suffix) : null_string;
41 }
42
43 } // end namespace stlplus
44
This page took 0.031243 seconds and 4 git commands to generate.