X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2Fstlplus%2Fstrings%2Fstring_smart_ptr.tpp;h=994b363dd07912fdfef7b61f2ba936f7dc29b4a6;hp=7953fbf3f7587f4efca460cec2293f376c367166;hb=5846afb00833cc72fe72422ca896d2387c712cb4;hpb=a97500609dc3c1b11f9786d32bc458eb00de4c36 diff --git a/src/stlplus/strings/string_smart_ptr.tpp b/src/stlplus/strings/string_smart_ptr.tpp index 7953fbf..994b363 100644 --- a/src/stlplus/strings/string_smart_ptr.tpp +++ b/src/stlplus/strings/string_smart_ptr.tpp @@ -1,44 +1,44 @@ -//////////////////////////////////////////////////////////////////////////////// - -// Author: Andy Rushton -// Copyright: (c) Southampton University 1999-2004 -// (c) Andy Rushton 2004-2009 -// License: BSD License, see ../docs/license.html - -//////////////////////////////////////////////////////////////////////////////// - -namespace stlplus -{ - - template - std::string smart_ptr_to_string(const smart_ptr& value, - S to_string_fn, - const std::string& null_string, - const std::string& prefix, - const std::string& suffix) - { - return value ? (prefix + to_string_fn(*value) + suffix) : null_string; - } - - template - std::string smart_ptr_clone_to_string(const smart_ptr_clone& value, - S to_string_fn, - const std::string& null_string, - const std::string& prefix, - const std::string& suffix) - { - return value ? (prefix + to_string_fn(*value) + suffix) : null_string; - } - - template - std::string smart_ptr_nocopy_to_string(const smart_ptr_nocopy& value, - S to_string_fn, - const std::string& null_string, - const std::string& prefix, - const std::string& suffix) - { - return value ? (prefix + to_string_fn(*value) + suffix) : null_string; - } - -} // end namespace stlplus - +//////////////////////////////////////////////////////////////////////////////// + +// Author: Andy Rushton +// Copyright: (c) Southampton University 1999-2004 +// (c) Andy Rushton 2004-2009 +// License: BSD License, see ../docs/license.html + +//////////////////////////////////////////////////////////////////////////////// + +namespace stlplus +{ + + template + std::string smart_ptr_to_string(const smart_ptr& value, + S to_string_fn, + const std::string& null_string, + const std::string& prefix, + const std::string& suffix) + { + return value ? (prefix + to_string_fn(*value) + suffix) : null_string; + } + + template + std::string smart_ptr_clone_to_string(const smart_ptr_clone& value, + S to_string_fn, + const std::string& null_string, + const std::string& prefix, + const std::string& suffix) + { + return value ? (prefix + to_string_fn(*value) + suffix) : null_string; + } + + template + std::string smart_ptr_nocopy_to_string(const smart_ptr_nocopy& value, + S to_string_fn, + const std::string& null_string, + const std::string& prefix, + const std::string& suffix) + { + return value ? (prefix + to_string_fn(*value) + suffix) : null_string; + } + +} // end namespace stlplus +