ROSE  0.11.83.1
StringToNumber.h
1 #ifndef ROSE_StringUtility_StringToNumber_H
2 #define ROSE_StringUtility_StringToNumber_H
3 
4 #include <Rose/StringUtility/NumberToString.h>
5 #include <rosedll.h>
6 
7 #include <string>
8 #include <vector>
9 
10 namespace Rose {
11 namespace StringUtility {
12 
14 // Number parsing
16 
21 ROSE_UTIL_API unsigned hexadecimalToInt(char);
22 
52 template<class Container, class Stringifier>
53 std::vector<std::string> toStrings(const Container &numbers, const Stringifier &stringifier=numberToString) {
54  return toStrings_range(numbers.begin(), numbers.end(), stringifier);
55 }
56 template<class Iterator, class Stringifier>
57 std::vector<std::string> toStrings_range(Iterator begin, Iterator end, const Stringifier &stringifier=numberToString) {
58  std::vector<std::string> retval;
59  for (/*void*/; begin!=end; ++begin)
60  retval.push_back(stringifier(*begin));
61  return retval;
62 }
65 } // namespace
66 } // namespace
67 
68 #endif
ROSE_UTIL_API std::string numberToString(long long)
Convert an integer to a string.
std::vector< std::string > toStrings_range(Iterator begin, Iterator end, const Stringifier &stringifier=numberToString)
Converts a bunch of numbers to strings.
Main namespace for the ROSE library.
ROSE_UTIL_API unsigned hexadecimalToInt(char)
Convert an ASCII hexadecimal character to an integer.
std::vector< std::string > toStrings(const Container &numbers, const Stringifier &stringifier=numberToString)
Converts a bunch of numbers to strings.
Shortens names of int64_t stringifiers.
Definition: stringify.h:20