4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
6 // The contents of this file are subject to the Fraunhofer FOKUS Public License
7 // Version 1.0 (the "License"); you may not use this file except in compliance
8 // with the License. You may obtain a copy of the License at
9 // http://senf.berlios.de/license.html
11 // The Fraunhofer FOKUS Public License Version 1.0 is based on,
12 // but modifies the Mozilla Public License Version 1.1.
13 // See the full license text for the amendments.
15 // Software distributed under the License is distributed on an "AS IS" basis,
16 // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
17 // for the specific language governing rights and limitations under the License.
19 // The Original Code is Fraunhofer FOKUS code.
21 // The Initial Developer of the Original Code is Fraunhofer-Gesellschaft e.V.
22 // (registered association), Hansastraße 27 c, 80686 Munich, Germany.
23 // All Rights Reserved.
26 // Stefan Bund <g0dil@berlios.de>
29 \brief String public header */
31 #ifndef HH_SENF_Utils_String_
32 #define HH_SENF_Utils_String_ 1
37 //#include "String.mpp"
38 //-/////////////////////////////////////////////////////////////////////////////////////////////////
42 /** \brief Join string range with separator into single string
44 This utility will build string by joining all elements of \a range into a single string
45 using \a sep as separator. The \a range may contain values of any streamable type.
47 template <class ForwardReadableRange>
48 std::string stringJoin(ForwardReadableRange const & range, std::string sep);
50 /** \brief Get string representation
52 Returns the result of streaming the argument into a standard library string-based
53 stream and then out as a std::string object. The conversion is done with
54 <tt>boost::lexical_cast</tt>. The call is equivalent to
56 boost::lexical_cast<std::string>(t);
59 <tt>t</tt> must be <i>OutputStreamable</i>,
60 meaning that an <tt>operator\<\<</tt> is defined\n
61 <tt>t</tt> must be <i>CopyConstructible</i>
63 \see <a href="http://www.boost.org/doc/libs/release/libs/conversion/lexical_cast.htm">
64 boost::lexical_cast</a>
67 std::string str(T const & t);
69 template <class Target, class Source>
70 Target lexical_cast(Source const & arg);
72 namespace detail { template <class Target> class lexical_caster; }
74 template <class Target>
75 detail::lexical_caster<Target> lexical_cast();
78 //-/////////////////////////////////////////////////////////////////////////////////////////////////
79 //#include "String.cci"
89 // c-file-style: "senf"
90 // indent-tabs-mode: nil
91 // ispell-local-dictionary: "american"
92 // compile-command: "scons -u test"