- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLabels.cpp
More file actions
Latest commit
19 lines (15 loc) · 499 Bytes
/
Copy pathLabels.cpp
File metadata and controls
19 lines (15 loc) · 499 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include"Labels.hpp"
#include<sstream>
std::string Labels::addStr(const std::string& str, const std::string& prefix) {
std::stringstream buf;
buf << 'L' << '_' << _labels.size() << '_' << prefix;
const std::string label = buf.str();
_labels[label] = str;
return label;
}
voidLabels::eval(std::ostream& out) const {
for (auto& pair : _labels) {
out << pair.first << ':' << std::endl;
out << "\t.ascii\t\"" << pair.second << "\\0\"" << std::endl;
}
}