}
string log::dump() {
- ifstream from(name);
+ std::ifstream from(name);
string res;
string v;
- while (getline(from, v))
+ while (std::getline(from, v))
res += v + "\n";
from.close();
return res;
void log::restore(string s) {
LOG << "restore: " << s;
- ofstream f(name, ios::trunc);
+ std::ofstream f(name, std::ios::trunc);
f << s;
f.close();
}
// XXX should be an atomic operation
void log::loginstance(unsigned instance, string v) {
- ofstream f(name, ios::app);
+ std::ofstream f(name, std::ios::app);
f << "done " << instance << " " << v << "\n";
f.close();
}
// an acceptor should call logprop(promise) when it
// receives a prepare to which it responds prepare_ok().
void log::logprop(prop_t promise) {
- ofstream f(name, ios::app);
+ std::ofstream f(name, std::ios::app);
f << "propseen " << promise.n << " " << promise.m << "\n";
f.close();
}
// an acceptor should call logaccept(accepted, accepted_value) when it
// receives an accept RPC to which it replies accept_ok().
void log::logaccept(prop_t n, string v) {
- ofstream f(name, ios::app);
+ std::ofstream f(name, std::ios::app);
f << "accepted " << n.n << " " << n.m << " " << v << "\n";
f.close();
}