~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/util/convert.h

Reverted 1103

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
 
 
31
 
#include "drizzled/visibility.h"
32
 
 
33
 
namespace drizzled
34
 
{
 
27
#include <stdint.h>
35
28
 
36
29
template <class T>
37
30
std::string to_string(T t)
38
31
{
39
 
  return boost::lexical_cast<std::string>(t);
 
32
  std::ostringstream o;
 
33
  o << t;
 
34
  return o.str();
40
35
}
41
36
 
42
37
template <class T>
47
42
  return str;
48
43
}
49
44
 
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 */
 
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