8#ifndef HPP_ALIB_ENUMS_RECORDPARSER
9#define HPP_ALIB_ENUMS_RECORDPARSER 1
18#include "alib/strings/substring.hpp"
20namespace alib {
namespace enums {
111 if( input.
IsNull () )
error(
"Input string is nulled" );
189 template<
typename TIntegral>
191 void Get( TIntegral& result,
bool isLastField=
false );
193 template<
typename TIntegral>
196 Get( TIntegral& result,
bool isLastField=
false )
199 if( bigInt == (std::numeric_limits<integer>::max)() ) result= (std::numeric_limits<TIntegral>::max)();
200 else if( bigInt == (std::numeric_limits<integer>::min)() ) result= (std::numeric_limits<TIntegral>::min)();
201 else result=
static_cast<TIntegral
>( bigInt );
218 template<
typename TEnum>
220 void Get( TEnum& result,
bool isLastField=
false );
222 template<
typename TEnum>
225 Get( TEnum& result,
bool isLastField=
false )
227 typename std::underlying_type<TEnum>::type resultIntegral;
229 result= TEnum( resultIntegral );
240 ALIB_API static void Get(
double& result,
bool isLastField=
false );
constexpr bool IsNull() const
constexpr bool IsEmpty() const
constexpr const TChar * Buffer() const
#define ALIB_ASSERT_MODULE(modulename)
#define ATMP_VOID_IF(Cond)
characters::character character
Type alias in namespace alib.
lang::integer integer
Type alias in namespace alib.
static ALIB_API void Get(String &result, bool isLastField=false)
static ALIB_API void Get(character &result, bool isLastField=false)
static void Get(TIntegral &result, bool isLastField=false)
static ALIB_API void assertNoUnnecessary(character specificChar, const NCString &where)
static ALIB_API NString ResourceCategory
The resource category (if a resourced string was parsed).
static ALIB_API integer getInteger(bool isLastField)
static ALIB_API void Delim()
static ALIB_API void Get(double &result, bool isLastField=false)
static ALIB_API void assertEndOfInput()
Asserts that the Input is empty.
static ALIB_API void OuterDelim()
static ALIB_API void assertChar(character specificChar, const NCString &where)
static ALIB_API void assertNoWhitespaces(const NCString &where)
static ALIB_API Substring Input
The remaining input string.
static ALIB_API String OriginalInput
A backup of the originally given string to parse.
static ALIB_API void assertEndOfRecord()
Asserts that either Input is empty, or an OuterDelimChar follows.
static ALIB_API void Initialize(const String &input, character innerDelim, character outerDelim, const NString &resourceCategory, const NString &resourceName)
static ALIB_API character InnerDelimChar
The delimiter of fields of a record.
static ALIB_API NString ResourceName
The resource name (if a resourced string was parsed).
static ALIB_API void assertNoTrailingWhitespaces(String &token)
static ALIB_API character OuterDelimChar
The delimiter of records.
static ALIB_API void error(const NCString &what)
static void Get(TEnum &result, bool isLastField=false)