serializer: define order of including files in includedir 77/205477/1
authorAdrian Szyndela <adrian.s@samsung.com>
Mon, 6 May 2019 11:03:09 +0000 (13:03 +0200)
committerAdrian Szyndela <adrian.s@samsung.com>
Mon, 6 May 2019 11:59:55 +0000 (13:59 +0200)
In the reference documentation <includedir> has an undefined
order of including files from a directory.

This makes the order unoficially and implicitly defined to make
generated serialized files equal for the same set of files.
It does not mean that users may now rely on it.

The order is alphabetical.

Change-Id: I07fd137e6a9646a541387bb0ef205edfc012f5f9

src/internal/xml_parser.cpp

index faa2dfe..b188d0a 100644 (file)
@@ -290,6 +290,7 @@ void XmlParser::getIncludedFiles(const std::string& parent_dir, const std::strin
                        }
                }
                closedir(dir);
+               sort(files.begin(), files.end());
 
                if (tslog::enabled()) {
                        std::cout << "\nincludedir: " << incldir << ", " << files.size() << " included files found:\n";