Skip to content

Commit

Permalink
Add Local Date, Local Time, and Local Date-Time support.
Browse files Browse the repository at this point in the history
  • Loading branch information
skystrife committed Jan 19, 2017
1 parent d6e097f commit 6806a8f
Show file tree
Hide file tree
Showing 2 changed files with 332 additions and 129 deletions.
18 changes: 17 additions & 1 deletion examples/parse_stdin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,23 @@ class toml_test_writer
stream_ << "{\"type\":\"float\",\"value\":\"" << v.get() << "\"}";
}

void visit(const cpptoml::value<cpptoml::datetime>& v)
void visit(const cpptoml::value<cpptoml::local_date>& v)
{
stream_ << "{\"type\":\"local_date\",\"value\":\"" << v.get() << "\"}";
}

void visit(const cpptoml::value<cpptoml::local_time>& v)
{
stream_ << "{\"type\":\"local_time\",\"value\":\"" << v.get() << "\"}";
}

void visit(const cpptoml::value<cpptoml::local_datetime>& v)
{
stream_ << "{\"type\":\"local_datetime\",\"value\":\"" << v.get()
<< "\"}";
}

void visit(const cpptoml::value<cpptoml::offset_datetime>& v)
{
stream_ << "{\"type\":\"datetime\",\"value\":\"" << v.get() << "\"}";
}
Expand Down
Loading

0 comments on commit 6806a8f

Please sign in to comment.