{
SGPath p(absolutePath());
if (p.exists()) {
-// what is indexValid for?
-// bool indexValid = false;
try {
// already exists on disk
parseDirIndex(children);
-// indexValid = true;
std::sort(children.begin(), children.end());
} catch (sg_exception& e) {
// parsing cache failed
{
SGPath p(absolutePath());
p.append(".dirindex");
- std::ifstream indexStream( p.str().c_str(), std::ios::in );
+ std::ifstream indexStream( p.c_str(), std::ios::in );
if ( !indexStream.is_open() ) {
throw sg_io_exception("cannot open dirIndex file", p);
// dir index data has changed, so write to disk and update
// the hash accordingly
- std::ofstream of(pathInRepo().str().c_str(), std::ios::trunc | std::ios::out);
+ std::ofstream of(pathInRepo().c_str(), std::ios::trunc | std::ios::out);
assert(of.is_open());
of.write(body.data(), body.size());
of.close();
SGPath cachePath = basePath;
cachePath.append(".hashes");
- std::ofstream stream(cachePath.str().c_str(),std::ios::out | std::ios::trunc);
+ std::ofstream stream(cachePath.c_str(),std::ios::out | std::ios::trunc);
HashCache::const_iterator it;
for (it = hashes.begin(); it != hashes.end(); ++it) {
stream << it->filePath << ":" << it->modTime << ":"
return;
}
- std::ifstream stream(cachePath.str().c_str(), std::ios::in);
+ std::ifstream stream(cachePath.c_str(), std::ios::in);
char buf[2048];
char* lastToken;
std::string prName = comps.at(comps.size() - 2);
{
- std::ofstream f(p.str().c_str(), std::ios::trunc | std::ios::out);
+ std::ofstream f(p.c_str(), std::ios::trunc | std::ios::out);
f << dataForFile(prName, comps.back(), revision);
}
}
SGPath modFile(p);
modFile.append("dirB/subdirA/fileBAA");
{
- std::ofstream of(modFile.str().c_str(), std::ios::out | std::ios::trunc);
+ std::ofstream of(modFile.c_str(), std::ios::out | std::ios::trunc);
of << "complete nonsense";
of.close();
}