~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/util/convert.h

Merged embedded-innodb-index-lookup into embedded-innodb-delete-row.

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