ParseJson():
Minor: some reformatting of source code.
This commit is contained in:
parent
58d8f16681
commit
c6b8a37263
@ -384,7 +384,7 @@ bool Configuration::ParseJson(Configuration* cfg, const char* json)
|
|||||||
ATBPaymentRate PaymentRate;
|
ATBPaymentRate PaymentRate;
|
||||||
ATBSpecialDaysWorktime SpecialDaysWorktime;
|
ATBSpecialDaysWorktime SpecialDaysWorktime;
|
||||||
ATBSpecialDays SpecialDays;
|
ATBSpecialDays SpecialDays;
|
||||||
ATBWeekDays WeekDays;
|
//ATBWeekDay WeekDay;
|
||||||
ATBWeekDaysWorktime WeekDaysWorktime;
|
ATBWeekDaysWorktime WeekDaysWorktime;
|
||||||
ATBPeriodYear YearPeriod;
|
ATBPeriodYear YearPeriod;
|
||||||
ATBDailyTicket DailyTicket;
|
ATBDailyTicket DailyTicket;
|
||||||
@ -400,29 +400,29 @@ bool Configuration::ParseJson(Configuration* cfg, const char* json)
|
|||||||
MemberType mb_type = MemberType::UnknownType;
|
MemberType mb_type = MemberType::UnknownType;
|
||||||
this->currentPaymentOptions.clear();
|
this->currentPaymentOptions.clear();
|
||||||
|
|
||||||
// Get all JSON object members
|
// Get all JSON object members
|
||||||
// This code should run only once (to load JSON variables into memory)
|
// This code should run only once (to load JSON variables into memory)
|
||||||
for (auto i = document.MemberBegin(); i != document.MemberEnd(); i++)
|
for (auto i = document.MemberBegin(); i != document.MemberEnd(); i++)
|
||||||
{
|
{
|
||||||
// Get name of all general members of JSON, don't print name if NULL
|
// Get name of all general members of JSON, don't print name if NULL
|
||||||
const char* mb_name = i->name.GetString();
|
const char* mb_name = i->name.GetString();
|
||||||
if (mb_name == NULL) continue;
|
if (mb_name == NULL) continue;
|
||||||
|
|
||||||
if (document[mb_name].IsString()) {
|
if (document[mb_name].IsString()) {
|
||||||
QString const _mb_name(mb_name);
|
QString const _mb_name(mb_name);
|
||||||
if (_mb_name.startsWith("Project", Qt::CaseInsensitive)) {
|
if (_mb_name.startsWith("Project", Qt::CaseInsensitive)) {
|
||||||
cfg->project.project = document[mb_name].GetString();
|
cfg->project.project = document[mb_name].GetString();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (_mb_name.startsWith("Version", Qt::CaseInsensitive)) {
|
if (_mb_name.startsWith("Version", Qt::CaseInsensitive)) {
|
||||||
cfg->project.version = document[mb_name].GetString();
|
cfg->project.version = document[mb_name].GetString();
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
if (_mb_name.startsWith("Info", Qt::CaseInsensitive)) {
|
||||||
|
cfg->project.info = document[mb_name].GetString();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (_mb_name.startsWith("Info", Qt::CaseInsensitive)) {
|
|
||||||
cfg->project.info = document[mb_name].GetString();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ... everything else should be an array
|
// ... everything else should be an array
|
||||||
if (!document[mb_name].IsArray()) {
|
if (!document[mb_name].IsArray()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user