~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/util/convert.h

  • Committer: lbieber
  • Date: 2010-10-02 19:48:35 UTC
  • mfrom: (1730.6.19 drizzle-make-lcov)
  • Revision ID: lbieber@orisndriz08-20101002194835-q5zd9qc4lvx1xnfo
Merge Hartmut - clean up lex, now require flex to build, also "make lcov" improvements

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