Fix a couple of wrong white spaces

This commit is contained in:
Michael Friedrich 2015-09-18 13:04:09 +02:00
parent 57179f3bdd
commit f7b5aa33ce
14 changed files with 26 additions and 26 deletions

View File

@ -162,4 +162,4 @@ void ApiClient::ObjectsHttpCompletionCallback(HttpRequest& request,
}
callback(objects);
}
}

View File

@ -121,15 +121,15 @@ void ConfigObject::ModifyAttribute(const String& attr, const Value& value, bool
bool updated_original_attributes = false;
Type::Ptr type = GetReflectionType();
std::vector<String> tokens;
boost::algorithm::split(tokens, attr, boost::is_any_of("."));
String fieldName = tokens[0];
int fid = type->GetFieldId(fieldName);
Field field = type->GetFieldInfo(fid);
Value oldValue = GetField(fid);
if (field.Attributes & FAConfig) {
@ -143,25 +143,25 @@ void ConfigObject::ModifyAttribute(const String& attr, const Value& value, bool
original_attributes->Set(attr, oldValue);
}
}
Value newValue;
if (tokens.size() > 1) {
newValue = oldValue.Clone();
Value current = newValue;
if (current.IsEmpty()) {
current = new Dictionary();
newValue = current;
}
for (std::vector<String>::size_type i = 1; i < tokens.size() - 1; i++) {
if (!current.IsObjectType<Dictionary>())
BOOST_THROW_EXCEPTION(std::invalid_argument("Value must be a dictionary."));
Dictionary::Ptr dict = current;
const String& key = tokens[i];
if (!dict->Contains(key)) {
current = new Dictionary();
dict->Set(key, current);
@ -169,13 +169,13 @@ void ConfigObject::ModifyAttribute(const String& attr, const Value& value, bool
current = dict->Get(key);
}
}
if (!current.IsObjectType<Dictionary>())
BOOST_THROW_EXCEPTION(std::invalid_argument("Value must be a dictionary."));
Dictionary::Ptr dict = current;
const String& key = tokens[tokens.size() - 1];
dict->Set(key, value);
} else
newValue = value;
@ -259,7 +259,7 @@ void ConfigObject::Activate(void)
}
SetAuthority(true);
NotifyActive();
}

View File

@ -137,4 +137,4 @@ void ObjectListCommand::PrintTypeCounts(std::ostream& fp, const std::map<String,
fp << ".\n";
}
}
}

View File

@ -151,4 +151,4 @@ void ObjectListUtility::PrintArray(std::ostream& fp, const Array::Ptr& arr)
fp << " ";
fp << "]";
}
}

View File

@ -231,4 +231,4 @@ size_t HttpResponse::ReadBody(char *data, size_t count)
return 0;
else
return m_Body->Read(data, count, true);
}
}

View File

@ -250,4 +250,4 @@ die:
if (phQuery)
PdhCloseQuery(phQuery);
return 3;
}
}

View File

@ -213,4 +213,4 @@ INT check_memory(printInfoStruct& printInfo)
delete pMemBuf;
return -1;
}
}

View File

@ -400,4 +400,4 @@ VOID FormatPDHError(PDH_STATUS status)
std::wcout << pMessage << '\n';
LocalFree(pMessage);
}
}

View File

@ -444,4 +444,4 @@ die:
delete reinterpret_cast<VOID *>(repBuf);
return 3;
}
}

View File

@ -206,4 +206,4 @@ INT check_swap(printInfoStruct& printInfo)
printInfo.aSwap = round(MemBuf.ullAvailPageFile / pow(1024.0, printInfo.unit));
return -1;
}
}

View File

@ -249,4 +249,4 @@ die:
if (criteria)
SysFreeString(criteria);
return 3;
}
}

View File

@ -216,4 +216,4 @@ VOID getUptime(printInfoStruct& printInfo)
printInfo.time = uptime.count();
break;
}
}
}

View File

@ -232,4 +232,4 @@ INT check_users(printInfoStruct& printInfo)
WTSFreeMemory(pSessionInfo);
printInfo.users = users;
return -1;
}
}

View File

@ -226,4 +226,4 @@ VOID die(DWORD err)
std::wcout << "Failed to format error message, last error was: " << err << '\n';
else
std::wcout << mBuf << std::endl;
}
}