Commit f39f0d2b authored by Ben Huber's avatar Ben Huber

faster lookup of doxygen tags and finding version without git tags

parent c766e0a8
Pipeline #761 passed with stages
in 8 minutes and 19 seconds
......@@ -24,7 +24,7 @@ class TabsConverter < Converter
.gsub('<p>__infoEnd</p>', "</div>")
.gsub('__breakFix1</a></p>', "")
.gsub('<p>__breakFix2', "</a>")
.gsub('__version', %x( git describe --tags --always --abbrev=0 ) )
.gsub('__version', %x( cat ../VERSION ) )
.gsub(/__doxyref\(([^\)]+)\)/){ |m| %x( ./findDoxytag #{$1} ) }
end
end
......
......@@ -13,6 +13,33 @@ int main(int argc, char *argv[]) {
std::string memberName(argv[1]);
std::ifstream inFile("xerus.tags");
std::string line;
std::size_t jumpSize = 100;
// seek rough position
auto lastPos = inFile.tellg();
while (!inFile.eof()) {
lastPos = inFile.tellg();
for (size_t i=0; i<jumpSize; ++i) {
std::getline(inFile, line);
}
std::vector<std::string> parts;
boost::split(parts, line, boost::is_any_of("\t"));
if (parts[0] == memberName) {
std::cout << parts[1] << std::endl;
return 0;
}
if (parts[0] > memberName) {
inFile.seekg(lastPos);
jumpSize /= 10;
if (jumpSize == 1) {
break;
}
}
}
if (inFile.eof()) {
inFile.clear();
inFile.seekg(lastPos);
}
while (std::getline(inFile, line)) {
std::vector<std::string> parts;
boost::split(parts, line, boost::is_any_of("\t"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment