~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/util/convert.h

  • Committer: Jay Pipes
  • Date: 2009-02-28 17:49:22 UTC
  • mto: (910.2.6 mordred-noatomics)
  • mto: This revision was merged to the branch mainline in revision 908.
  • Revision ID: jpipes@serialcoder-20090228174922-jczgt4d0662fqmnf
Merging in old r902 temporal changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#ifndef DRIZZLED_UTIL_CONVERT_H
22
 
#define DRIZZLED_UTIL_CONVERT_H
 
21
#ifndef DRIZZLE_SERVER_UTIL_CONVERT
 
22
#define DRIZZLE_SERVER_UTIL_CONVERT
23
23
 
24
 
#include <boost/lexical_cast.hpp>
25
24
#include <string>
26
25
#include <iostream>
27
26
#include <sstream>
28
27
 
29
 
namespace drizzled
30
 
{
31
 
 
32
28
template <class T>
33
29
std::string to_string(T t)
34
30
{
35
 
  return boost::lexical_cast<std::string>(t);
 
31
  std::ostringstream o;
 
32
  o << t;
 
33
  return o.str();
36
34
}
37
35
 
38
36
template <class T>
43
41
  return str;
44
42
}
45
43
 
46
 
void bytesToHexdumpFormat(std::string &s, const unsigned char *from, size_t from_length);
47
 
 
48
 
uint64_t drizzled_string_to_hex(char *to, const char *from,
49
 
                                uint64_t from_size);
50
 
void drizzled_hex_to_string(char *to, const char *from, uint64_t from_size);
51
 
 
52
 
} /* namespace drizzled */
53
 
 
54
 
#endif /* DRIZZLED_UTIL_CONVERT_H */
 
44
#endif