|
|
@ -266,14 +266,10 @@ public:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/** Returns the pointer to a C string. */
|
|
|
|
/** Returns the pointer to a C string. */
|
|
|
|
const Char *data() const {
|
|
|
|
const Char *data() const { return data_; }
|
|
|
|
return data_;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Returns the string size. */
|
|
|
|
/** Returns the string size. */
|
|
|
|
std::size_t size() const {
|
|
|
|
std::size_t size() const { return size_; }
|
|
|
|
return size_;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
friend bool operator==(BasicStringRef lhs, BasicStringRef rhs) {
|
|
|
|
friend bool operator==(BasicStringRef lhs, BasicStringRef rhs) {
|
|
|
|
return lhs.data_ == rhs.data_;
|
|
|
|
return lhs.data_ == rhs.data_;
|
|
|
@ -333,9 +329,7 @@ public:
|
|
|
|
BasicCStringRef(const std::basic_string<Char> &s) : data_(s.c_str()) {}
|
|
|
|
BasicCStringRef(const std::basic_string<Char> &s) : data_(s.c_str()) {}
|
|
|
|
|
|
|
|
|
|
|
|
/** Returns the pointer to a C string. */
|
|
|
|
/** Returns the pointer to a C string. */
|
|
|
|
const Char *c_str() const {
|
|
|
|
const Char *c_str() const { return data_; }
|
|
|
|
return data_;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
typedef BasicCStringRef<char> CStringRef;
|
|
|
|
typedef BasicCStringRef<char> CStringRef;
|
|
|
@ -363,9 +357,7 @@ inline stdext::checked_array_iterator<T*> make_ptr(T *ptr, std::size_t size) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
template <typename T>
|
|
|
|
template <typename T>
|
|
|
|
inline T *make_ptr(T *ptr, std::size_t) {
|
|
|
|
inline T *make_ptr(T *ptr, std::size_t) { return ptr; }
|
|
|
|
return ptr;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
} // namespace internal
|
|
|
|
} // namespace internal
|
|
|
|
|
|
|
|
|
|
|
@ -399,14 +391,10 @@ public:
|
|
|
|
virtual ~Buffer() {}
|
|
|
|
virtual ~Buffer() {}
|
|
|
|
|
|
|
|
|
|
|
|
/** Returns the size of this buffer. */
|
|
|
|
/** Returns the size of this buffer. */
|
|
|
|
std::size_t size() const {
|
|
|
|
std::size_t size() const { return size_; }
|
|
|
|
return size_;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Returns the capacity of this buffer. */
|
|
|
|
/** Returns the capacity of this buffer. */
|
|
|
|
std::size_t capacity() const {
|
|
|
|
std::size_t capacity() const { return capacity_; }
|
|
|
|
return capacity_;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
Resizes the buffer. If T is a POD type new elements may not be initialized.
|
|
|
|
Resizes the buffer. If T is a POD type new elements may not be initialized.
|
|
|
@ -439,12 +427,8 @@ public:
|
|
|
|
template <typename U>
|
|
|
|
template <typename U>
|
|
|
|
void append(const U *begin, const U *end);
|
|
|
|
void append(const U *begin, const U *end);
|
|
|
|
|
|
|
|
|
|
|
|
T &operator[](std::size_t index) {
|
|
|
|
T &operator[](std::size_t index) { return ptr_[index]; }
|
|
|
|
return ptr_[index];
|
|
|
|
const T &operator[](std::size_t index) const { return ptr_[index]; }
|
|
|
|
}
|
|
|
|
|
|
|
|
const T &operator[](std::size_t index) const {
|
|
|
|
|
|
|
|
return ptr_[index];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
template <typename T>
|
|
|
@ -477,9 +461,7 @@ protected:
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
explicit MemoryBuffer(const Allocator &alloc = Allocator())
|
|
|
|
explicit MemoryBuffer(const Allocator &alloc = Allocator())
|
|
|
|
: Allocator(alloc), Buffer<T>(data_, SIZE) {}
|
|
|
|
: Allocator(alloc), Buffer<T>(data_, SIZE) {}
|
|
|
|
~MemoryBuffer() {
|
|
|
|
~MemoryBuffer() { free(); }
|
|
|
|
free();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if FMT_USE_RVALUE_REFERENCES
|
|
|
|
#if FMT_USE_RVALUE_REFERENCES
|
|
|
|
private:
|
|
|
|
private:
|
|
|
@ -493,8 +475,7 @@ private:
|
|
|
|
this->ptr_ = data_;
|
|
|
|
this->ptr_ = data_;
|
|
|
|
std::copy(other.data_,
|
|
|
|
std::copy(other.data_,
|
|
|
|
other.data_ + this->size_, make_ptr(data_, this->capacity_));
|
|
|
|
other.data_ + this->size_, make_ptr(data_, this->capacity_));
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
else {
|
|
|
|
|
|
|
|
this->ptr_ = other.ptr_;
|
|
|
|
this->ptr_ = other.ptr_;
|
|
|
|
// Set pointer to the inline array so that delete is not called
|
|
|
|
// Set pointer to the inline array so that delete is not called
|
|
|
|
// when freeing.
|
|
|
|
// when freeing.
|
|
|
@ -516,9 +497,7 @@ public:
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// Returns a copy of the allocator associated with this buffer.
|
|
|
|
// Returns a copy of the allocator associated with this buffer.
|
|
|
|
Allocator get_allocator() const {
|
|
|
|
Allocator get_allocator() const { return *this; }
|
|
|
|
return *this;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
template <typename T, std::size_t SIZE, typename Allocator>
|
|
|
|
template <typename T, std::size_t SIZE, typename Allocator>
|
|
|
@ -564,19 +543,11 @@ inline int getsign(double x) {
|
|
|
|
|
|
|
|
|
|
|
|
// Portable version of isinf.
|
|
|
|
// Portable version of isinf.
|
|
|
|
# ifdef isinf
|
|
|
|
# ifdef isinf
|
|
|
|
inline int isinfinity(double x) {
|
|
|
|
inline int isinfinity(double x) { return isinf(x); }
|
|
|
|
return isinf(x);
|
|
|
|
inline int isinfinity(long double x) { return isinf(x); }
|
|
|
|
}
|
|
|
|
|
|
|
|
inline int isinfinity(long double x) {
|
|
|
|
|
|
|
|
return isinf(x);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
# else
|
|
|
|
# else
|
|
|
|
inline int isinfinity(double x) {
|
|
|
|
inline int isinfinity(double x) { return std::isinf(x); }
|
|
|
|
return std::isinf(x);
|
|
|
|
inline int isinfinity(long double x) { return std::isinf(x); }
|
|
|
|
}
|
|
|
|
|
|
|
|
inline int isinfinity(long double x) {
|
|
|
|
|
|
|
|
return std::isinf(x);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
# endif
|
|
|
|
# endif
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
inline int getsign(double value) {
|
|
|
|
inline int getsign(double value) {
|
|
|
@ -587,9 +558,7 @@ inline int getsign(double value) {
|
|
|
|
_ecvt_s(buffer, sizeof(buffer), value, 0, &dec, &sign);
|
|
|
|
_ecvt_s(buffer, sizeof(buffer), value, 0, &dec, &sign);
|
|
|
|
return sign;
|
|
|
|
return sign;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
inline int isinfinity(double x) {
|
|
|
|
inline int isinfinity(double x) { return !_finite(x); }
|
|
|
|
return !_finite(x);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
inline int isinfinity(long double x) {
|
|
|
|
inline int isinfinity(long double x) {
|
|
|
|
return !_finite(static_cast<double>(x));
|
|
|
|
return !_finite(static_cast<double>(x));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -603,9 +572,7 @@ public:
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
typedef Char *CharPtr;
|
|
|
|
typedef Char *CharPtr;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
static Char cast(wchar_t value) {
|
|
|
|
static Char cast(wchar_t value) { return static_cast<Char>(value); }
|
|
|
|
return static_cast<Char>(value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
template <typename Char>
|
|
|
|
template <typename Char>
|
|
|
@ -618,9 +585,7 @@ private:
|
|
|
|
static char convert(wchar_t);
|
|
|
|
static char convert(wchar_t);
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
static char convert(char value) {
|
|
|
|
static char convert(char value) { return value; }
|
|
|
|
return value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Formats a floating-point number.
|
|
|
|
// Formats a floating-point number.
|
|
|
|
template <typename T>
|
|
|
|
template <typename T>
|
|
|
@ -631,12 +596,8 @@ public:
|
|
|
|
template <>
|
|
|
|
template <>
|
|
|
|
class CharTraits<wchar_t> : public BasicCharTraits<wchar_t> {
|
|
|
|
class CharTraits<wchar_t> : public BasicCharTraits<wchar_t> {
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
static wchar_t convert(char value) {
|
|
|
|
static wchar_t convert(char value) { return value; }
|
|
|
|
return value;
|
|
|
|
static wchar_t convert(wchar_t value) { return value; }
|
|
|
|
}
|
|
|
|
|
|
|
|
static wchar_t convert(wchar_t value) {
|
|
|
|
|
|
|
|
return value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
template <typename T>
|
|
|
|
static int format_float(wchar_t *buffer, std::size_t size,
|
|
|
|
static int format_float(wchar_t *buffer, std::size_t size,
|
|
|
@ -647,17 +608,13 @@ public:
|
|
|
|
template <bool IsSigned>
|
|
|
|
template <bool IsSigned>
|
|
|
|
struct SignChecker {
|
|
|
|
struct SignChecker {
|
|
|
|
template <typename T>
|
|
|
|
template <typename T>
|
|
|
|
static bool is_negative(T value) {
|
|
|
|
static bool is_negative(T value) { return value < 0; }
|
|
|
|
return value < 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
template <>
|
|
|
|
template <>
|
|
|
|
struct SignChecker<false> {
|
|
|
|
struct SignChecker<false> {
|
|
|
|
template <typename T>
|
|
|
|
template <typename T>
|
|
|
|
static bool is_negative(T) {
|
|
|
|
static bool is_negative(T) { return false; }
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Returns true if value is negative, false otherwise.
|
|
|
|
// Returns true if value is negative, false otherwise.
|
|
|
@ -669,14 +626,10 @@ inline bool is_negative(T value) {
|
|
|
|
|
|
|
|
|
|
|
|
// Selects uint32_t if FitsIn32Bits is true, uint64_t otherwise.
|
|
|
|
// Selects uint32_t if FitsIn32Bits is true, uint64_t otherwise.
|
|
|
|
template <bool FitsIn32Bits>
|
|
|
|
template <bool FitsIn32Bits>
|
|
|
|
struct TypeSelector {
|
|
|
|
struct TypeSelector { typedef uint32_t Type; };
|
|
|
|
typedef uint32_t Type;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template <>
|
|
|
|
template <>
|
|
|
|
struct TypeSelector<false> {
|
|
|
|
struct TypeSelector<false> { typedef uint64_t Type; };
|
|
|
|
typedef uint64_t Type;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
template <typename T>
|
|
|
|
struct IntTraits {
|
|
|
|
struct IntTraits {
|
|
|
@ -688,9 +641,7 @@ struct IntTraits {
|
|
|
|
|
|
|
|
|
|
|
|
// MakeUnsigned<T>::Type gives an unsigned type corresponding to integer type T.
|
|
|
|
// MakeUnsigned<T>::Type gives an unsigned type corresponding to integer type T.
|
|
|
|
template <typename T>
|
|
|
|
template <typename T>
|
|
|
|
struct MakeUnsigned {
|
|
|
|
struct MakeUnsigned { typedef T Type; };
|
|
|
|
typedef T Type;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define FMT_SPECIALIZE_MAKE_UNSIGNED(T, U) \
|
|
|
|
#define FMT_SPECIALIZE_MAKE_UNSIGNED(T, U) \
|
|
|
|
template <> \
|
|
|
|
template <> \
|
|
|
@ -798,18 +749,10 @@ private:
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
explicit UTF8ToUTF16(StringRef s);
|
|
|
|
explicit UTF8ToUTF16(StringRef s);
|
|
|
|
operator WStringRef() const {
|
|
|
|
operator WStringRef() const { return WStringRef(&buffer_[0], size()); }
|
|
|
|
return WStringRef(&buffer_[0], size());
|
|
|
|
size_t size() const { return buffer_.size() - 1; }
|
|
|
|
}
|
|
|
|
const wchar_t *c_str() const { return &buffer_[0]; }
|
|
|
|
size_t size() const {
|
|
|
|
std::wstring str() const { return std::wstring(&buffer_[0], size()); }
|
|
|
|
return buffer_.size() - 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const wchar_t *c_str() const {
|
|
|
|
|
|
|
|
return &buffer_[0];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
std::wstring str() const {
|
|
|
|
|
|
|
|
return std::wstring(&buffer_[0], size());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// A converter from UTF-16 to UTF-8.
|
|
|
|
// A converter from UTF-16 to UTF-8.
|
|
|
@ -821,18 +764,10 @@ private:
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
UTF16ToUTF8() {}
|
|
|
|
UTF16ToUTF8() {}
|
|
|
|
explicit UTF16ToUTF8(WStringRef s);
|
|
|
|
explicit UTF16ToUTF8(WStringRef s);
|
|
|
|
operator StringRef() const {
|
|
|
|
operator StringRef() const { return StringRef(&buffer_[0], size()); }
|
|
|
|
return StringRef(&buffer_[0], size());
|
|
|
|
size_t size() const { return buffer_.size() - 1; }
|
|
|
|
}
|
|
|
|
const char *c_str() const { return &buffer_[0]; }
|
|
|
|
size_t size() const {
|
|
|
|
std::string str() const { return std::string(&buffer_[0], size()); }
|
|
|
|
return buffer_.size() - 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *c_str() const {
|
|
|
|
|
|
|
|
return &buffer_[0];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string str() const {
|
|
|
|
|
|
|
|
return std::string(&buffer_[0], size());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Performs conversion returning a system error code instead of
|
|
|
|
// Performs conversion returning a system error code instead of
|
|
|
|
// throwing exception on conversion error. This method may still throw
|
|
|
|
// throwing exception on conversion error. This method may still throw
|
|
|
@ -945,25 +880,17 @@ template<bool B, class T = void>
|
|
|
|
struct EnableIf {};
|
|
|
|
struct EnableIf {};
|
|
|
|
|
|
|
|
|
|
|
|
template<class T>
|
|
|
|
template<class T>
|
|
|
|
struct EnableIf<true, T> {
|
|
|
|
struct EnableIf<true, T> { typedef T type; };
|
|
|
|
typedef T type;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<bool B, class T, class F>
|
|
|
|
template<bool B, class T, class F>
|
|
|
|
struct Conditional {
|
|
|
|
struct Conditional { typedef T type; };
|
|
|
|
typedef T type;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<class T, class F>
|
|
|
|
template<class T, class F>
|
|
|
|
struct Conditional<false, T, F> {
|
|
|
|
struct Conditional<false, T, F> { typedef F type; };
|
|
|
|
typedef F type;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// A helper function to suppress bogus "conditional expression is constant"
|
|
|
|
// A helper function to suppress bogus "conditional expression is constant"
|
|
|
|
// warnings.
|
|
|
|
// warnings.
|
|
|
|
inline bool check(bool value) {
|
|
|
|
inline bool check(bool value) { return value; }
|
|
|
|
return value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Makes an Arg object from any type.
|
|
|
|
// Makes an Arg object from any type.
|
|
|
|
template <typename Char>
|
|
|
|
template <typename Char>
|
|
|
@ -1059,9 +986,7 @@ public:
|
|
|
|
MakeValue(typename WCharHelper<wchar_t, Char>::Supported value) {
|
|
|
|
MakeValue(typename WCharHelper<wchar_t, Char>::Supported value) {
|
|
|
|
int_value = value;
|
|
|
|
int_value = value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
static uint64_t type(wchar_t) {
|
|
|
|
static uint64_t type(wchar_t) { return Arg::CHAR; }
|
|
|
|
return Arg::CHAR;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define FMT_MAKE_STR_VALUE(Type, TYPE) \
|
|
|
|
#define FMT_MAKE_STR_VALUE(Type, TYPE) \
|
|
|
|
MakeValue(Type value) { set_string(value); } \
|
|
|
|
MakeValue(Type value) { set_string(value); } \
|
|
|
@ -1110,14 +1035,10 @@ public:
|
|
|
|
// Additional template param `Char_` is needed here because make_type always
|
|
|
|
// Additional template param `Char_` is needed here because make_type always
|
|
|
|
// uses MakeValue<char>.
|
|
|
|
// uses MakeValue<char>.
|
|
|
|
template <typename Char_>
|
|
|
|
template <typename Char_>
|
|
|
|
MakeValue(const NamedArg<Char_> &value) {
|
|
|
|
MakeValue(const NamedArg<Char_> &value) { pointer = &value; }
|
|
|
|
pointer = &value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template <typename Char_>
|
|
|
|
template <typename Char_>
|
|
|
|
static uint64_t type(const NamedArg<Char_> &) {
|
|
|
|
static uint64_t type(const NamedArg<Char_> &) { return Arg::NAMED_ARG; }
|
|
|
|
return Arg::NAMED_ARG;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
template <typename Char>
|
|
|
|
template <typename Char>
|
|
|
@ -1357,9 +1278,7 @@ private:
|
|
|
|
Arg do_get_arg(unsigned arg_index, const char *&error);
|
|
|
|
Arg do_get_arg(unsigned arg_index, const char *&error);
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
protected:
|
|
|
|
const ArgList &args() const {
|
|
|
|
const ArgList &args() const { return args_; }
|
|
|
|
return args_;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
explicit FormatterBase(const ArgList &args) {
|
|
|
|
explicit FormatterBase(const ArgList &args) {
|
|
|
|
args_ = args;
|
|
|
|
args_ = args;
|
|
|
@ -1427,9 +1346,7 @@ public:
|
|
|
|
BasicFormatter(const ArgList &args, BasicWriter<Char> &w)
|
|
|
|
BasicFormatter(const ArgList &args, BasicWriter<Char> &w)
|
|
|
|
: FormatterBase(args), writer_(w) {}
|
|
|
|
: FormatterBase(args), writer_(w) {}
|
|
|
|
|
|
|
|
|
|
|
|
BasicWriter<Char> &writer() {
|
|
|
|
BasicWriter<Char> &writer() { return writer_; }
|
|
|
|
return writer_;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void format(BasicCStringRef<Char> format_str);
|
|
|
|
void format(BasicCStringRef<Char> format_str);
|
|
|
|
|
|
|
|
|
|
|
@ -1452,24 +1369,12 @@ struct EmptySpec {};
|
|
|
|
// A type specifier.
|
|
|
|
// A type specifier.
|
|
|
|
template <char TYPE>
|
|
|
|
template <char TYPE>
|
|
|
|
struct TypeSpec : EmptySpec {
|
|
|
|
struct TypeSpec : EmptySpec {
|
|
|
|
Alignment align() const {
|
|
|
|
Alignment align() const { return ALIGN_DEFAULT; }
|
|
|
|
return ALIGN_DEFAULT;
|
|
|
|
unsigned width() const { return 0; }
|
|
|
|
}
|
|
|
|
int precision() const { return -1; }
|
|
|
|
unsigned width() const {
|
|
|
|
bool flag(unsigned) const { return false; }
|
|
|
|
return 0;
|
|
|
|
char type() const { return TYPE; }
|
|
|
|
}
|
|
|
|
char fill() const { return ' '; }
|
|
|
|
int precision() const {
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
bool flag(unsigned) const {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
char type() const {
|
|
|
|
|
|
|
|
return TYPE;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
char fill() const {
|
|
|
|
|
|
|
|
return ' ';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// A width specifier.
|
|
|
|
// A width specifier.
|
|
|
@ -1481,12 +1386,8 @@ struct WidthSpec {
|
|
|
|
|
|
|
|
|
|
|
|
WidthSpec(unsigned width, wchar_t fill) : width_(width), fill_(fill) {}
|
|
|
|
WidthSpec(unsigned width, wchar_t fill) : width_(width), fill_(fill) {}
|
|
|
|
|
|
|
|
|
|
|
|
unsigned width() const {
|
|
|
|
unsigned width() const { return width_; }
|
|
|
|
return width_;
|
|
|
|
wchar_t fill() const { return fill_; }
|
|
|
|
}
|
|
|
|
|
|
|
|
wchar_t fill() const {
|
|
|
|
|
|
|
|
return fill_;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// An alignment specifier.
|
|
|
|
// An alignment specifier.
|
|
|
@ -1496,13 +1397,9 @@ struct AlignSpec : WidthSpec {
|
|
|
|
AlignSpec(unsigned width, wchar_t fill, Alignment align = ALIGN_DEFAULT)
|
|
|
|
AlignSpec(unsigned width, wchar_t fill, Alignment align = ALIGN_DEFAULT)
|
|
|
|
: WidthSpec(width, fill), align_(align) {}
|
|
|
|
: WidthSpec(width, fill), align_(align) {}
|
|
|
|
|
|
|
|
|
|
|
|
Alignment align() const {
|
|
|
|
Alignment align() const { return align_; }
|
|
|
|
return align_;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int precision() const {
|
|
|
|
int precision() const { return -1; }
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// An alignment and type specifier.
|
|
|
|
// An alignment and type specifier.
|
|
|
@ -1510,12 +1407,8 @@ template <char TYPE>
|
|
|
|
struct AlignTypeSpec : AlignSpec {
|
|
|
|
struct AlignTypeSpec : AlignSpec {
|
|
|
|
AlignTypeSpec(unsigned width, wchar_t fill) : AlignSpec(width, fill) {}
|
|
|
|
AlignTypeSpec(unsigned width, wchar_t fill) : AlignSpec(width, fill) {}
|
|
|
|
|
|
|
|
|
|
|
|
bool flag(unsigned) const {
|
|
|
|
bool flag(unsigned) const { return false; }
|
|
|
|
return false;
|
|
|
|
char type() const { return TYPE; }
|
|
|
|
}
|
|
|
|
|
|
|
|
char type() const {
|
|
|
|
|
|
|
|
return TYPE;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// A full format specifier.
|
|
|
|
// A full format specifier.
|
|
|
@ -1528,15 +1421,9 @@ struct FormatSpec : AlignSpec {
|
|
|
|
unsigned width = 0, char type = 0, wchar_t fill = ' ')
|
|
|
|
unsigned width = 0, char type = 0, wchar_t fill = ' ')
|
|
|
|
: AlignSpec(width, fill), flags_(0), precision_(-1), type_(type) {}
|
|
|
|
: AlignSpec(width, fill), flags_(0), precision_(-1), type_(type) {}
|
|
|
|
|
|
|
|
|
|
|
|
bool flag(unsigned f) const {
|
|
|
|
bool flag(unsigned f) const { return (flags_ & f) != 0; }
|
|
|
|
return (flags_ & f) != 0;
|
|
|
|
int precision() const { return precision_; }
|
|
|
|
}
|
|
|
|
char type() const { return type_; }
|
|
|
|
int precision() const {
|
|
|
|
|
|
|
|
return precision_;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
char type() const {
|
|
|
|
|
|
|
|
return type_;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// An integer format specifier.
|
|
|
|
// An integer format specifier.
|
|
|
@ -1549,9 +1436,7 @@ public:
|
|
|
|
IntFormatSpec(T val, const SpecT &spec = SpecT())
|
|
|
|
IntFormatSpec(T val, const SpecT &spec = SpecT())
|
|
|
|
: SpecT(spec), value_(val) {}
|
|
|
|
: SpecT(spec), value_(val) {}
|
|
|
|
|
|
|
|
|
|
|
|
T value() const {
|
|
|
|
T value() const { return value_; }
|
|
|
|
return value_;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// A string format specifier.
|
|
|
|
// A string format specifier.
|
|
|
@ -1567,9 +1452,7 @@ public:
|
|
|
|
internal::CharTraits<Char>::convert(FillChar());
|
|
|
|
internal::CharTraits<Char>::convert(FillChar());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const Char *str() const {
|
|
|
|
const Char *str() const { return str_; }
|
|
|
|
return str_;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -1711,14 +1594,10 @@ inline StrFormatSpec<wchar_t> pad(
|
|
|
|
# define FMT_GEN15(f) FMT_GEN14(f), f(14)
|
|
|
|
# define FMT_GEN15(f) FMT_GEN14(f), f(14)
|
|
|
|
|
|
|
|
|
|
|
|
namespace internal {
|
|
|
|
namespace internal {
|
|
|
|
inline uint64_t make_type() {
|
|
|
|
inline uint64_t make_type() { return 0; }
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
template <typename T>
|
|
|
|
inline uint64_t make_type(const T &arg) {
|
|
|
|
inline uint64_t make_type(const T &arg) { return MakeValue<char>::type(arg); }
|
|
|
|
return MakeValue<char>::type(arg);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template <unsigned N>
|
|
|
|
template <unsigned N>
|
|
|
|
struct ArgArray {
|
|
|
|
struct ArgArray {
|
|
|
@ -1937,9 +1816,7 @@ public:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
FMT_VARIADIC_CTOR(SystemError, init, int, CStringRef)
|
|
|
|
FMT_VARIADIC_CTOR(SystemError, init, int, CStringRef)
|
|
|
|
|
|
|
|
|
|
|
|
int error_code() const {
|
|
|
|
int error_code() const { return error_code_; }
|
|
|
|
return error_code_;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -1972,13 +1849,9 @@ private:
|
|
|
|
|
|
|
|
|
|
|
|
#if _SECURE_SCL
|
|
|
|
#if _SECURE_SCL
|
|
|
|
// Returns pointer value.
|
|
|
|
// Returns pointer value.
|
|
|
|
static Char *get(CharPtr p) {
|
|
|
|
static Char *get(CharPtr p) { return p.base(); }
|
|
|
|
return p.base();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
static Char *get(Char *p) {
|
|
|
|
static Char *get(Char *p) { return p; }
|
|
|
|
return p;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// Fills the padding around the content and returns the pointer to the
|
|
|
|
// Fills the padding around the content and returns the pointer to the
|
|
|
@ -2010,8 +1883,7 @@ private:
|
|
|
|
if (internal::is_negative(value)) {
|
|
|
|
if (internal::is_negative(value)) {
|
|
|
|
abs_value = 0 - abs_value;
|
|
|
|
abs_value = 0 - abs_value;
|
|
|
|
*write_unsigned_decimal(abs_value, 1) = '-';
|
|
|
|
*write_unsigned_decimal(abs_value, 1) = '-';
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
else {
|
|
|
|
|
|
|
|
write_unsigned_decimal(abs_value, 0);
|
|
|
|
write_unsigned_decimal(abs_value, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2085,17 +1957,13 @@ public:
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
Returns the total number of characters written.
|
|
|
|
Returns the total number of characters written.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
std::size_t size() const {
|
|
|
|
std::size_t size() const { return buffer_.size(); }
|
|
|
|
return buffer_.size();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
Returns a pointer to the output buffer content. No terminating null
|
|
|
|
Returns a pointer to the output buffer content. No terminating null
|
|
|
|
character is appended.
|
|
|
|
character is appended.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
const Char *data() const FMT_NOEXCEPT {
|
|
|
|
const Char *data() const FMT_NOEXCEPT { return &buffer_[0]; }
|
|
|
|
return &buffer_[0];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
Returns a pointer to the output buffer content with terminating null
|
|
|
|
Returns a pointer to the output buffer content with terminating null
|
|
|
@ -2251,15 +2119,12 @@ typename BasicWriter<Char>::CharPtr BasicWriter<Char>::write_str(
|
|
|
|
if (spec.align() == ALIGN_RIGHT) {
|
|
|
|
if (spec.align() == ALIGN_RIGHT) {
|
|
|
|
std::fill_n(out, spec.width() - size, fill);
|
|
|
|
std::fill_n(out, spec.width() - size, fill);
|
|
|
|
out += spec.width() - size;
|
|
|
|
out += spec.width() - size;
|
|
|
|
}
|
|
|
|
} else if (spec.align() == ALIGN_CENTER) {
|
|
|
|
else if (spec.align() == ALIGN_CENTER) {
|
|
|
|
|
|
|
|
out = fill_padding(out, spec.width(), size, fill);
|
|
|
|
out = fill_padding(out, spec.width(), size, fill);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
else {
|
|
|
|
|
|
|
|
std::fill_n(out + size, spec.width() - size, fill);
|
|
|
|
std::fill_n(out + size, spec.width() - size, fill);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
else {
|
|
|
|
|
|
|
|
out = grow_buffer(size);
|
|
|
|
out = grow_buffer(size);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
std::copy(s, s + size, out);
|
|
|
|
std::copy(s, s + size, out);
|
|
|
@ -2325,20 +2190,17 @@ BasicWriter<Char>::prepare_int_buffer(
|
|
|
|
std::copy(prefix, prefix + prefix_size, p);
|
|
|
|
std::copy(prefix, prefix + prefix_size, p);
|
|
|
|
p += size;
|
|
|
|
p += size;
|
|
|
|
std::fill(p, end, fill);
|
|
|
|
std::fill(p, end, fill);
|
|
|
|
}
|
|
|
|
} else if (align == ALIGN_CENTER) {
|
|
|
|
else if (align == ALIGN_CENTER) {
|
|
|
|
|
|
|
|
p = fill_padding(p, width, size, fill);
|
|
|
|
p = fill_padding(p, width, size, fill);
|
|
|
|
std::copy(prefix, prefix + prefix_size, p);
|
|
|
|
std::copy(prefix, prefix + prefix_size, p);
|
|
|
|
p += size;
|
|
|
|
p += size;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
else {
|
|
|
|
|
|
|
|
if (align == ALIGN_NUMERIC) {
|
|
|
|
if (align == ALIGN_NUMERIC) {
|
|
|
|
if (prefix_size != 0) {
|
|
|
|
if (prefix_size != 0) {
|
|
|
|
p = std::copy(prefix, prefix + prefix_size, p);
|
|
|
|
p = std::copy(prefix, prefix + prefix_size, p);
|
|
|
|
size -= prefix_size;
|
|
|
|
size -= prefix_size;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
else {
|
|
|
|
|
|
|
|
std::copy(prefix, prefix + prefix_size, end - size);
|
|
|
|
std::copy(prefix, prefix + prefix_size, end - size);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
std::fill(p, end - size, fill);
|
|
|
|
std::fill(p, end - size, fill);
|
|
|
@ -2358,22 +2220,19 @@ void BasicWriter<Char>::write_int(T value, Spec spec) {
|
|
|
|
prefix[0] = '-';
|
|
|
|
prefix[0] = '-';
|
|
|
|
++prefix_size;
|
|
|
|
++prefix_size;
|
|
|
|
abs_value = 0 - abs_value;
|
|
|
|
abs_value = 0 - abs_value;
|
|
|
|
}
|
|
|
|
} else if (spec.flag(SIGN_FLAG)) {
|
|
|
|
else if (spec.flag(SIGN_FLAG)) {
|
|
|
|
|
|
|
|
prefix[0] = spec.flag(PLUS_FLAG) ? '+' : ' ';
|
|
|
|
prefix[0] = spec.flag(PLUS_FLAG) ? '+' : ' ';
|
|
|
|
++prefix_size;
|
|
|
|
++prefix_size;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
switch (spec.type()) {
|
|
|
|
switch (spec.type()) {
|
|
|
|
case 0:
|
|
|
|
case 0: case 'd': {
|
|
|
|
case 'd': {
|
|
|
|
|
|
|
|
unsigned num_digits = internal::count_digits(abs_value);
|
|
|
|
unsigned num_digits = internal::count_digits(abs_value);
|
|
|
|
CharPtr p = prepare_int_buffer(
|
|
|
|
CharPtr p = prepare_int_buffer(
|
|
|
|
num_digits, spec, prefix, prefix_size) + 1 - num_digits;
|
|
|
|
num_digits, spec, prefix, prefix_size) + 1 - num_digits;
|
|
|
|
internal::format_decimal(get(p), abs_value, num_digits);
|
|
|
|
internal::format_decimal(get(p), abs_value, num_digits);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 'x':
|
|
|
|
case 'x': case 'X': {
|
|
|
|
case 'X': {
|
|
|
|
|
|
|
|
UnsignedType n = abs_value;
|
|
|
|
UnsignedType n = abs_value;
|
|
|
|
if (spec.flag(HASH_FLAG)) {
|
|
|
|
if (spec.flag(HASH_FLAG)) {
|
|
|
|
prefix[prefix_size++] = '0';
|
|
|
|
prefix[prefix_size++] = '0';
|
|
|
@ -2393,8 +2252,7 @@ void BasicWriter<Char>::write_int(T value, Spec spec) {
|
|
|
|
} while ((n >>= 4) != 0);
|
|
|
|
} while ((n >>= 4) != 0);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 'b':
|
|
|
|
case 'b': case 'B': {
|
|
|
|
case 'B': {
|
|
|
|
|
|
|
|
UnsignedType n = abs_value;
|
|
|
|
UnsignedType n = abs_value;
|
|
|
|
if (spec.flag(HASH_FLAG)) {
|
|
|
|
if (spec.flag(HASH_FLAG)) {
|
|
|
|
prefix[prefix_size++] = '0';
|
|
|
|
prefix[prefix_size++] = '0';
|
|
|
@ -2444,10 +2302,7 @@ void BasicWriter<Char>::write_double(
|
|
|
|
case 0:
|
|
|
|
case 0:
|
|
|
|
type = 'g';
|
|
|
|
type = 'g';
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'e':
|
|
|
|
case 'e': case 'f': case 'g': case 'a':
|
|
|
|
case 'f':
|
|
|
|
|
|
|
|
case 'g':
|
|
|
|
|
|
|
|
case 'a':
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'F':
|
|
|
|
case 'F':
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
#ifdef _MSC_VER
|
|
|
@ -2455,9 +2310,7 @@ void BasicWriter<Char>::write_double(
|
|
|
|
type = 'f';
|
|
|
|
type = 'f';
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
// Fall through.
|
|
|
|
// Fall through.
|
|
|
|
case 'E':
|
|
|
|
case 'E': case 'G': case 'A':
|
|
|
|
case 'G':
|
|
|
|
|
|
|
|
case 'A':
|
|
|
|
|
|
|
|
upper = true;
|
|
|
|
upper = true;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
@ -2471,8 +2324,7 @@ void BasicWriter<Char>::write_double(
|
|
|
|
if (internal::getsign(static_cast<double>(value))) {
|
|
|
|
if (internal::getsign(static_cast<double>(value))) {
|
|
|
|
sign = '-';
|
|
|
|
sign = '-';
|
|
|
|
value = -value;
|
|
|
|
value = -value;
|
|
|
|
}
|
|
|
|
} else if (spec.flag(SIGN_FLAG)) {
|
|
|
|
else if (spec.flag(SIGN_FLAG)) {
|
|
|
|
|
|
|
|
sign = spec.flag(PLUS_FLAG) ? '+' : ' ';
|
|
|
|
sign = spec.flag(PLUS_FLAG) ? '+' : ' ';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2525,8 +2377,7 @@ void BasicWriter<Char>::write_double(
|
|
|
|
*format_ptr++ = '#';
|
|
|
|
*format_ptr++ = '#';
|
|
|
|
if (spec.align() == ALIGN_CENTER) {
|
|
|
|
if (spec.align() == ALIGN_CENTER) {
|
|
|
|
width_for_sprintf = 0;
|
|
|
|
width_for_sprintf = 0;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
else {
|
|
|
|
|
|
|
|
if (spec.align() == ALIGN_LEFT)
|
|
|
|
if (spec.align() == ALIGN_LEFT)
|
|
|
|
*format_ptr++ = '-';
|
|
|
|
*format_ptr++ = '-';
|
|
|
|
if (width != 0)
|
|
|
|
if (width != 0)
|
|
|
@ -2563,8 +2414,7 @@ void BasicWriter<Char>::write_double(
|
|
|
|
*start != ' ') {
|
|
|
|
*start != ' ') {
|
|
|
|
*(start - 1) = sign;
|
|
|
|
*(start - 1) = sign;
|
|
|
|
sign = 0;
|
|
|
|
sign = 0;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
else {
|
|
|
|
|
|
|
|
*(start - 1) = fill;
|
|
|
|
*(start - 1) = fill;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
++n;
|
|
|
|
++n;
|
|
|
@ -2926,15 +2776,9 @@ private:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
explicit FormatInt(int value) {
|
|
|
|
explicit FormatInt(int value) { FormatSigned(value); }
|
|
|
|
FormatSigned(value);
|
|
|
|
explicit FormatInt(long value) { FormatSigned(value); }
|
|
|
|
}
|
|
|
|
explicit FormatInt(LongLong value) { FormatSigned(value); }
|
|
|
|
explicit FormatInt(long value) {
|
|
|
|
|
|
|
|
FormatSigned(value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
explicit FormatInt(LongLong value) {
|
|
|
|
|
|
|
|
FormatSigned(value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
explicit FormatInt(unsigned value) : str_(format_decimal(value)) {}
|
|
|
|
explicit FormatInt(unsigned value) : str_(format_decimal(value)) {}
|
|
|
|
explicit FormatInt(unsigned long value) : str_(format_decimal(value)) {}
|
|
|
|
explicit FormatInt(unsigned long value) : str_(format_decimal(value)) {}
|
|
|
|
explicit FormatInt(ULongLong value) : str_(format_decimal(value)) {}
|
|
|
|
explicit FormatInt(ULongLong value) : str_(format_decimal(value)) {}
|
|
|
@ -2942,17 +2786,13 @@ public:
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
Returns the number of characters written to the output buffer.
|
|
|
|
Returns the number of characters written to the output buffer.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
std::size_t size() const {
|
|
|
|
std::size_t size() const { return buffer_ - str_ + BUFFER_SIZE - 1; }
|
|
|
|
return buffer_ - str_ + BUFFER_SIZE - 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
Returns a pointer to the output buffer content. No terminating null
|
|
|
|
Returns a pointer to the output buffer content. No terminating null
|
|
|
|
character is appended.
|
|
|
|
character is appended.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
const char *data() const {
|
|
|
|
const char *data() const { return str_; }
|
|
|
|
return str_;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
Returns a pointer to the output buffer content with terminating null
|
|
|
|
Returns a pointer to the output buffer content with terminating null
|
|
|
@ -2968,9 +2808,7 @@ public:
|
|
|
|
Returns the content of the output buffer as an ``std::string``.
|
|
|
|
Returns the content of the output buffer as an ``std::string``.
|
|
|
|
\endrst
|
|
|
|
\endrst
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
std::string str() const {
|
|
|
|
std::string str() const { return std::string(str_, size()); }
|
|
|
|
return std::string(str_, size());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Formats a decimal integer value writing into buffer and returns
|
|
|
|
// Formats a decimal integer value writing into buffer and returns
|
|
|
|