~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/util/convert.h

  • Committer: Brian Aker
  • Date: 2009-10-02 21:34:26 UTC
  • mfrom: (1134.1.4 bug426504)
  • Revision ID: brian@gaz-20091002213426-7ojknrpknoedaprl
Merge Monty

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
 
 
29
 
namespace drizzled
30
 
{
 
27
#include <stdint.h>
31
28
 
32
29
template <class T>
33
30
std::string to_string(T t)
34
31
{
35
 
  return boost::lexical_cast<std::string>(t);
 
32
  std::ostringstream o;
 
33
  o << t;
 
34
  return o.str();
36
35
}
37
36
 
38
37
template <class T>
43
42
  return str;
44
43
}
45
44
 
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 */
 
45
extern "C"
 
46
{
 
47
  uint64_t drizzled_string_to_hex(char *to, const char *from,
 
48
                                  uint64_t from_size);
 
49
}
 
50
 
 
51
#endif