~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/util/convert.h

  • Committer: Brian Aker
  • Date: 2009-02-21 00:18:15 UTC
  • Revision ID: brian@tangent.org-20090221001815-x20e8h71e984lvs1
Completion (?) of uint conversion.

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
 
 
22
 
 
23
 
#ifndef DRIZZLED_UTIL_CONVERT_H
24
 
#define DRIZZLED_UTIL_CONVERT_H
25
 
 
26
 
#include <boost/lexical_cast.hpp>
 
21
#ifndef DRIZZLE_SERVER_UTIL_CONVERT
 
22
#define DRIZZLE_SERVER_UTIL_CONVERT
 
23
 
27
24
#include <string>
28
25
#include <iostream>
29
26
#include <sstream>
30
27
 
31
 
#include "drizzled/visibility.h"
32
 
 
33
 
namespace drizzled
34
 
{
35
 
 
36
28
template <class T>
37
29
std::string to_string(T t)
38
30
{
39
 
  return boost::lexical_cast<std::string>(t);
 
31
  std::ostringstream o;
 
32
  o << t;
 
33
  return o.str();
40
34
}
41
35
 
42
36
template <class T>
47
41
  return str;
48
42
}
49
43
 
50
 
void bytesToHexdumpFormat(std::string &s, const unsigned char *from, size_t from_length);
51
 
 
52
 
DRIZZLED_API uint64_t drizzled_string_to_hex(char *to, const char *from,
53
 
                                             uint64_t from_size);
54
 
DRIZZLED_API void drizzled_hex_to_string(char *to, const char *from,
55
 
                                         uint64_t from_size);
56
 
 
57
 
} /* namespace drizzled */
58
 
 
59
 
#endif /* DRIZZLED_UTIL_CONVERT_H */
 
44
#endif