diff --git a/ResourceFiles/ResInfo.cc b/ResourceFiles/ResInfo.cc index ff8c207ecd..6bc01bb72e 100644 --- a/ResourceFiles/ResInfo.cc +++ b/ResourceFiles/ResInfo.cc @@ -38,8 +38,9 @@ int main(int argc, char *argv[]) ("creator,c", "print creator code") ("all,a", "print all info") ("format,f", "print format") - ("count,n", "print number of resources") - ("filename,l", "echo input file name") + ("count,n", "print number of resources") + ("size,s", "show data fork size") + ("filename,l", "echo input file name") ("set-format,F", po::value(), "resource fork format)") ; po::options_description hidden, alldesc; @@ -82,11 +83,12 @@ int main(int argc, char *argv[]) bool showCreator = options.count("creator") != 0; bool showFormat = options.count("format") != 0; bool showCount = options.count("count") != 0; - + bool showSize = options.count("size") != 0; + ResourceFile::Format format = ResourceFile::Format::autodetect; if(options.count("all")) - showType = showCreator = showFormat = showCount = true; + showType = showCreator = showFormat = showCount = showSize = true; if(options.count("set-format")) { @@ -121,7 +123,9 @@ int main(int argc, char *argv[]) out << " " << reverseFormats[rsrcFile.format]; if(showCount) out << " " << rsrcFile.resources.resources.size(); - + if(showSize) + out << " " << rsrcFile.data.size(); + string str = out.str(); if(str.size()) { diff --git a/ResourceFiles/ResourceFile.cc b/ResourceFiles/ResourceFile.cc index 4d40db699c..ba9b332ed8 100644 --- a/ResourceFiles/ResourceFile.cc +++ b/ResourceFiles/ResourceFile.cc @@ -270,9 +270,11 @@ bool ResourceFile::read() switch(what) { case 1: - std::vector buf(len); - in.read(buf, len); - data = std::string(buf.begin(), buf.end()); + { + std::vector buf(len); + in.read(buf.data(), len); + data = std::string(buf.begin(), buf.end()); + } break; case 2: resources = Resources(in); @@ -344,7 +346,7 @@ bool ResourceFile::read() if(word(in) != crc) return false; std::vector buf(datasize); - in.read(buf, datasize); + in.read(buf.data(), datasize); data = std::string(buf.begin(), buf.end()); in.seekg(128 + datasize); resources = Resources(in);