MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / set

Method set

src/openms/source/DATASTRUCTURES/Date.cpp:23–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21 }
22
23 void Date::set(const String& date)
24 {
25 clear();
26
27 //check for format (german/english)
28 if (date.has('.'))
29 {
30 QDate::operator=(QDate::fromString(date.c_str(), "dd.MM.yyyy"));
31 }
32 else if (date.has('/'))
33 {
34 QDate::operator=(QDate::fromString(date.c_str(), "MM/dd/yyyy"));
35 }
36 else if (date.has('-'))
37 {
38 QDate::operator=(QDate::fromString(date.c_str(), "yyyy-MM-dd"));
39 }
40
41 if (!isValid())
42 {
43 throw Exception::ParseError(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, date, "Is no valid german, english or iso date");
44 }
45 }
46
47 void Date::set(UInt month, UInt day, UInt year)
48 {

Callers

nothing calls this directly

Calls 5

clearFunction · 0.50
operator=Function · 0.50
isValidFunction · 0.50
StringClass · 0.50
hasMethod · 0.45

Tested by

no test coverage detected