NCBI C++ ToolKit
Classes | Typedefs | Functions | Variables
convert_dates_iso8601.cpp File Reference
#include <ncbi_pch.hpp>
#include <sstream>
#include <memory>
#include <util/static_map.hpp>
#include <util/xregexp/regexp.hpp>
#include <util/xregexp/convert_dates_iso8601.hpp>
+ Include dependency graph for convert_dates_iso8601.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

class  TParse_rule
 
class  CAmbiguousDateException
 

Typedefs

typedef string(* TFun_transform) (string const &)
 
typedef pair< string, string >(* TFun_transform_other) (string const &)
 

Functions

static pair< string, stringextract_date_iso8601 (string const &value, vector< TParse_rule > const &rules, vector< TFun_transform_other > const &range_rules, TFun_transform_other ambig_rule)
 
static vector< TParse_rule > constget_date_rule_collection ()
 
static vector< TFun_transform_other > constget_date_range_rule_collection ()
 
static TFun_transform_other get_transform_for_ambiguous_date ()
 
static string transform_identity (string const &value)
 
static string transform_missing (string const &value)
 
static string transform_YYYY_mm_DD (string const &value)
 
static string transform_mm_DD_YYYY (string const &value)
 
static string transform_DD_mm_YYYY (string const &value)
 
static string transform_DD_month_YYYY (string const &value)
 
static string transform_DD_month_comma_YYYY (string const &value)
 
static string transform_month_DD_YYYY (string const &value)
 
static string transform_month_YYYY (string const &value)
 
static string transform_YYYY_month (string const &value)
 
static string transform_MM_YYYY (string const &value)
 
static string transform_YYYY_MM (string const &value)
 
static string transform_range_decade (string const &value)
 
static string transform_range_before (string const &value)
 
static pair< string, stringtransform_ambiguous_date (string const &value)
 
static pair< string, stringtransform_range (string const &value)
 
string ConvertDateTo_iso8601 (string const &value)
 Convert dates from an arbitrary format to corresponding ISO 8601. More...
 
pair< string, stringConvertDateTo_iso8601_and_annotate (string const &value)
 Convert dates from an arbitrary format to corresponding ISO 8601, with annotation. More...
 
const char * get_month_code_by_name (string const &month_name)
 

Variables

static const char * kTransform_code_iso8601 = "ISO-8601"
 
static const char * transfrom_code_range_iso8601 = "RANGE|ISO-8601"
 
static const char * kTransform_code_cast_na = "CAST|NA"
 
static const char * kTransform_code_cast_iso8601 = "CAST|ISO-8601"
 
static const char * kTransform_code_range_cast_iso8601 = "RANGE|CAST|ISO-8601"
 
static const char * kTransform_code_no_date = "NODATE"
 
static const char * kTransform_code_cast_ambig = "CAST|YYYY"
 

Typedef Documentation

◆ TFun_transform

typedef string(* TFun_transform) (string const &)

Definition at line 53 of file convert_dates_iso8601.cpp.

◆ TFun_transform_other

typedef pair<string, string>(* TFun_transform_other) (string const &)

Definition at line 54 of file convert_dates_iso8601.cpp.

Function Documentation

◆ extract_date_iso8601()

pair< string, string > extract_date_iso8601 ( string const value,
vector< TParse_rule > const rules,
vector< TFun_transform_other > const range_rules,
TFun_transform_other  ambig_rule 
)
static

◆ get_date_range_rule_collection()

vector< TFun_transform_other > const & get_date_range_rule_collection ( )
static

◆ get_date_rule_collection()

vector< TParse_rule > const & get_date_rule_collection ( )
static

◆ get_month_code_by_name()

const char* get_month_code_by_name ( string const month_name)

◆ get_transform_for_ambiguous_date()

TFun_transform_other get_transform_for_ambiguous_date ( )
static

◆ transform_ambiguous_date()

pair< string, string > transform_ambiguous_date ( string const value)
static

◆ transform_DD_mm_YYYY()

string transform_DD_mm_YYYY ( string const value)
static

Definition at line 548 of file convert_dates_iso8601.cpp.

References NCBI_THROW, NStr::Split(), and rapidjson::value.

Referenced by get_date_rule_collection().

◆ transform_DD_month_comma_YYYY()

string transform_DD_month_comma_YYYY ( string const value)
static

◆ transform_DD_month_YYYY()

string transform_DD_month_YYYY ( string const value)
static

◆ transform_identity()

string transform_identity ( string const value)
static

Definition at line 492 of file convert_dates_iso8601.cpp.

References rapidjson::value.

Referenced by get_date_rule_collection().

◆ transform_missing()

string transform_missing ( string const value)
static

Definition at line 497 of file convert_dates_iso8601.cpp.

Referenced by get_date_rule_collection().

◆ transform_mm_DD_YYYY()

string transform_mm_DD_YYYY ( string const value)
static

Definition at line 519 of file convert_dates_iso8601.cpp.

References NCBI_THROW, NStr::Split(), and rapidjson::value.

Referenced by get_date_rule_collection().

◆ transform_MM_YYYY()

string transform_MM_YYYY ( string const value)
static

Definition at line 706 of file convert_dates_iso8601.cpp.

References NStr::Split(), and rapidjson::value.

Referenced by get_date_rule_collection().

◆ transform_month_DD_YYYY()

string transform_month_DD_YYYY ( string const value)
static

◆ transform_month_YYYY()

string transform_month_YYYY ( string const value)
static

◆ transform_range()

pair< string, string > transform_range ( string const value)
static

◆ transform_range_before()

string transform_range_before ( string const value)
static

Definition at line 735 of file convert_dates_iso8601.cpp.

References rapidjson::value.

Referenced by get_date_rule_collection().

◆ transform_range_decade()

string transform_range_decade ( string const value)
static

Definition at line 723 of file convert_dates_iso8601.cpp.

References rapidjson::value.

Referenced by get_date_rule_collection().

◆ transform_YYYY_MM()

string transform_YYYY_MM ( string const value)
static

Definition at line 689 of file convert_dates_iso8601.cpp.

References NStr::Split(), and rapidjson::value.

Referenced by get_date_rule_collection().

◆ transform_YYYY_mm_DD()

string transform_YYYY_mm_DD ( string const value)
static

Definition at line 502 of file convert_dates_iso8601.cpp.

References NStr::Split(), and rapidjson::value.

Referenced by get_date_rule_collection().

◆ transform_YYYY_month()

string transform_YYYY_month ( string const value)
static

Variable Documentation

◆ kTransform_code_cast_ambig

const char* kTransform_code_cast_ambig = "CAST|YYYY"
static

Definition at line 62 of file convert_dates_iso8601.cpp.

Referenced by transform_ambiguous_date().

◆ kTransform_code_cast_iso8601

const char* kTransform_code_cast_iso8601 = "CAST|ISO-8601"
static

Definition at line 59 of file convert_dates_iso8601.cpp.

Referenced by get_date_rule_collection().

◆ kTransform_code_cast_na

const char* kTransform_code_cast_na = "CAST|NA"
static

Definition at line 58 of file convert_dates_iso8601.cpp.

Referenced by get_date_rule_collection().

◆ kTransform_code_iso8601

const char* kTransform_code_iso8601 = "ISO-8601"
static

Definition at line 56 of file convert_dates_iso8601.cpp.

Referenced by get_date_rule_collection().

◆ kTransform_code_no_date

const char* kTransform_code_no_date = "NODATE"
static

◆ kTransform_code_range_cast_iso8601

const char* kTransform_code_range_cast_iso8601 = "RANGE|CAST|ISO-8601"
static

Definition at line 60 of file convert_dates_iso8601.cpp.

Referenced by get_date_rule_collection().

◆ transfrom_code_range_iso8601

const char* transfrom_code_range_iso8601 = "RANGE|ISO-8601"
static

Definition at line 57 of file convert_dates_iso8601.cpp.

Referenced by get_date_rule_collection().

Modified on Thu Jun 13 17:29:41 2024 by modify_doxy.py rev. 669887