本文整理汇总了C++中PJsonVal::GetObjStrV方法的典型用法代码示例。如果您正苦于以下问题:C++ PJsonVal::GetObjStrV方法的具体用法?C++ PJsonVal::GetObjStrV怎么用?C++ PJsonVal::GetObjStrV使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PJsonVal
的用法示例。
在下文中一共展示了PJsonVal::GetObjStrV方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EAssertR
//
// TBackupProfile
//
TBackupProfile::TBackupProfile(const PJsonVal& SettingsJson, const TStr& Destination_, const TStr& ProfileName_)
{
Destination = Destination_;
if (Destination.Len() > 0 && (Destination.LastCh() != '\\' || Destination.LastCh() != '/'))
Destination += "/";
ProfileName = ProfileName_;
if (!TDir::Exists(Destination))
TDir::GenDir(Destination);
VersionsToKeep = SettingsJson->GetObjInt("versionsToKeep", 1);
PJsonVal FoldersJson = SettingsJson->GetObjKey("folders");
EAssertR(FoldersJson->IsArr(), "Expected to get an array of folders");
for (int N = 0; N < FoldersJson->GetArrVals(); N++) {
PJsonVal FolderJson = FoldersJson->GetArrVal(N);
TBackupFolderInfo FolderInfo;
FolderInfo.Folder = FolderJson->GetObjStr("folder");
if (FolderJson->IsObjKey("extensions"))
FolderJson->GetObjStrV("extensions", FolderInfo.Extensions);
if (FolderInfo.Extensions.IsIn("*"))
FolderInfo.Extensions.Clr();
FolderInfo.IncludeSubfolders = FolderJson->GetObjBool("includeSubfolders");
if (FolderJson->IsObjKey("skipIfContaining"))
FolderJson->GetObjStrV("skipIfContaining", FolderInfo.SkipIfContainingV);
FolderV.Add(FolderInfo);
}
// load logs of the previous backups
ProfileLogFile = Destination + ProfileName + "/backupInfo.json";
if (TFile::Exists(ProfileLogFile)) {
PJsonVal LogJson = TJsonVal::GetValFromStr(TStr::LoadTxt(ProfileLogFile));
if (LogJson->IsArr()) {
for (int N = 0; N < LogJson->GetArrVals(); N++) {
PJsonVal Log = LogJson->GetArrVal(N);
LogV.Add(TBackupLogInfo(Log));
}
}
}
}