diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2014-02-08 15:09:25 -0800 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2014-02-08 16:18:22 -0800 |
commit | 730e5dde39333cb2f63c72a7d7152bee5c4dbb05 (patch) | |
tree | 510ef3e0ad46ecf1f2bee1fa42f26e6377b51686 /src/io/lock.cpp | |
parent | 7a15a3efe85837d52d950cc9f895eadcc9eb6be1 (diff) | |
download | tmwa-730e5dde39333cb2f63c72a7d7152bee5c4dbb05.tar.gz tmwa-730e5dde39333cb2f63c72a7d7152bee5c4dbb05.tar.bz2 tmwa-730e5dde39333cb2f63c72a7d7152bee5c4dbb05.tar.xz tmwa-730e5dde39333cb2f63c72a7d7152bee5c4dbb05.zip |
Implement AString
Diffstat (limited to 'src/io/lock.cpp')
-rw-r--r-- | src/io/lock.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/io/lock.cpp b/src/io/lock.cpp index c7cbda8..96c3649 100644 --- a/src/io/lock.cpp +++ b/src/io/lock.cpp @@ -46,7 +46,7 @@ namespace io int no = getpid(); // Get a filename that doesn't already exist - FString newfile; + AString newfile; do { newfile = STRPRINTF("%s_%d.tmp", filename, no++); @@ -59,7 +59,7 @@ namespace io return fd; } - WriteLock::WriteLock(FString fn, bool linebuffered) + WriteLock::WriteLock(RString fn, bool linebuffered) : WriteFile(get_lock_open(fn, &tmp_suffix), linebuffered), filename(fn) {} WriteLock::~WriteLock() @@ -72,16 +72,16 @@ namespace io } int n = backup_count; - FString old_filename = STRPRINTF("%s.%d", filename, n); + AString old_filename = STRPRINTF("%s.%d", filename, n); while (--n) { - FString newer_filename = STRPRINTF("%s.%d", filename, n); + AString newer_filename = STRPRINTF("%s.%d", filename, n); rename(newer_filename.c_str(), old_filename.c_str()); old_filename = std::move(newer_filename); } rename(filename.c_str(), old_filename.c_str()); - FString tmpfile = STRPRINTF("%s_%d.tmp", filename, tmp_suffix); + AString tmpfile = STRPRINTF("%s_%d.tmp", filename, tmp_suffix); rename(tmpfile.c_str(), filename.c_str()); } } // namespace io |