本文整理汇总了C++中QByteArray::toULong方法的典型用法代码示例。如果您正苦于以下问题:C++ QByteArray::toULong方法的具体用法?C++ QByteArray::toULong怎么用?C++ QByteArray::toULong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QByteArray
的用法示例。
在下文中一共展示了QByteArray::toULong方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readMotionOnly
bool ProjectAnimData::readMotionOnly(QFile *file){
if (!file || !file->isOpen()){
return false;
}
QByteArray line;
auto ok = false;
auto lineCount = 0UL;
if (!chopLine(file, line, lineCount)){
return false;
}
auto blocksize = line.toULong(&ok);
if (!ok){
return false;
}
animationMotionDataLines = blocksize;
while (!file->atEnd()){ //Read individual projects...
lineCount = 0;
for (; lineCount < blocksize;){ //Get animation motion data...
animationMotionData.append(new SkyrimAnimationMotionData(this));
if (!animationMotionData.last()->read(file, lineCount)){
return false;
}
}
return true;
}
return false;
}
示例2: read
bool ProjectAnimData::read(QFile *file){
QByteArray line;
auto ok = false;
auto lineCount = 0UL;
if (file && file->isOpen()){
if (!chopLine(file, line, lineCount)){
return false;
}
auto blocksize = line.toULong(&ok);
if (!ok){
return false;
}
animationDataLines = blocksize;
while (!file->atEnd()){ //Read individual projects...
lineCount = 0;
if (!chopLine(file, line, lineCount)){ //Read project filepaths...
return false;
}
auto count = line.toULong(&ok);
if (!ok || !chopLine(file, line, lineCount)){
return false;
}
auto numFiles = line.toULong(&ok);
if (!ok || numFiles <= 2){
return false;
}
for (auto j = 0UL; j < numFiles; j++){
if (!chopLine(file, line, lineCount) || (!line.contains(".hkx") && !line.contains(".HKX"))){
return false;
}
projectFiles.append(line);
}
if (!chopLine(file, line, lineCount)){
return false;
}
count = line.toULong(&ok);
if (!ok){
return false;
}
if (count > 0){
for (; lineCount < blocksize;){ //Read animation data...
animationData.append(new SkyrimClipGeneratoData(this, ""));
if (!animationData.last()->read(file, lineCount)){
return false;
}
}
if (!chopLine(file, line, lineCount)){
return false;
}
blocksize = line.toULong(&ok);
if (!ok){
return false;
}
lineCount = 0;
animationMotionDataLines = blocksize;
for (; lineCount < blocksize;){ //Get animation motion data...
animationMotionData.append(new SkyrimAnimationMotionData(this));
if (!animationMotionData.last()->read(file, lineCount)){
return false;
}
}
}
return true;
}
}
return false;
}