Replaced BOOST_FOREACH with c++11 ranged for loops

This commit is contained in:
mensinda
2016-04-05 22:53:54 +02:00
parent 4836a2993e
commit 18843fe5e1
33 changed files with 209 additions and 236 deletions

View File

@@ -48,13 +48,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "BlenderDNA.h"
#include "StreamReader.h"
#include "fast_atof.h"
#include <boost/foreach.hpp>
using namespace Assimp;
using namespace Assimp::Blender;
using namespace Assimp::Formatter;
#define for_each BOOST_FOREACH
bool match4(StreamReaderAny& stream, const char* string) {
char tmp[] = {
(stream).GetI1(),
@@ -86,7 +84,7 @@ void DNAParser :: Parse ()
}
std::vector<std::string> names (stream.GetI4());
for_each(std::string& s, names) {
for(std::string& s : names) {
while (char c = stream.GetI1()) {
s += c;
}
@@ -99,7 +97,7 @@ void DNAParser :: Parse ()
}
std::vector<Type> types (stream.GetI4());
for_each(Type& s, types) {
for(Type& s : types) {
while (char c = stream.GetI1()) {
s.name += c;
}
@@ -111,7 +109,7 @@ void DNAParser :: Parse ()
throw DeadlyImportError("BlenderDNA: Expected TLEN field");
}
for_each(Type& s, types) {
for(Type& s : types) {
s.size = stream.GetI2();
}
@@ -238,9 +236,9 @@ void DNA :: DumpToFile()
f << "Field format: type name offset size" << "\n";
f << "Structure format: name size" << "\n";
for_each(const Structure& s, structures) {
for(const Structure& s : structures) {
f << s.name << " " << s.size << "\n\n";
for_each(const Field& ff, s.fields) {
for(const Field& ff : s.fields) {
f << "\t" << ff.type << " " << ff.name << " " << ff.offset << " " << ff.size << std::endl;
}
f << std::endl;