diff options
author | Simon Warta <[email protected]> | 2015-06-23 11:16:05 +0200 |
---|---|---|
committer | Simon Warta <[email protected]> | 2015-06-23 11:16:05 +0200 |
commit | 7c993192825982826069c8b28f0a94d7b9f2fa65 (patch) | |
tree | 2f99740713c7c37e7c5432cf4c95500713a36e3e /src/cmd | |
parent | 167f65f9f20746d1a92456505e94c11c8b8552fd (diff) | |
parent | 5ca7fb9b6744ccad16feda0d4a14132cbce6cd30 (diff) |
Merge pull request #130 from webmaster128/fstream
ifstream/ostream take std::string
Diffstat (limited to 'src/cmd')
-rw-r--r-- | src/cmd/base64.cpp | 2 | ||||
-rw-r--r-- | src/cmd/compress.cpp | 8 | ||||
-rw-r--r-- | src/cmd/dsa_sign.cpp | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/cmd/base64.cpp b/src/cmd/base64.cpp index e0798dcee..84a30e8ea 100644 --- a/src/cmd/base64.cpp +++ b/src/cmd/base64.cpp @@ -59,7 +59,7 @@ int base64(int argc, char* argv[]) { std::istream* stream; if(files[j] == "-") stream = &std::cin; - else stream = new std::ifstream(files[j].c_str()); + else stream = new std::ifstream(files[j]); if(!*stream) { diff --git a/src/cmd/compress.cpp b/src/cmd/compress.cpp index 62f9eb7dc..ca5161644 100644 --- a/src/cmd/compress.cpp +++ b/src/cmd/compress.cpp @@ -42,7 +42,7 @@ int compress(int argc, char* argv[]) } const std::string in_file = argv[1]; - std::ifstream in(in_file.c_str()); + std::ifstream in(in_file); if(!in.good()) { @@ -62,7 +62,7 @@ int compress(int argc, char* argv[]) } const std::string out_file = in_file + "." + suffix; - std::ofstream out(out_file.c_str()); + std::ofstream out(out_file); do_compress(*compress, in, out); @@ -84,7 +84,7 @@ void parse_extension(const std::string& in_file, int uncompress(int argc, char* argv[]) { const std::string in_file = argv[1]; - std::ifstream in(in_file.c_str()); + std::ifstream in(in_file); if(!in.good()) { @@ -95,7 +95,7 @@ int uncompress(int argc, char* argv[]) std::string out_file, suffix; parse_extension(in_file, out_file, suffix); - std::ofstream out(out_file.c_str()); + std::ofstream out(out_file); std::unique_ptr<Transform> decompress(make_decompressor(suffix)); diff --git a/src/cmd/dsa_sign.cpp b/src/cmd/dsa_sign.cpp index 3941f6b71..8a7365329 100644 --- a/src/cmd/dsa_sign.cpp +++ b/src/cmd/dsa_sign.cpp @@ -39,7 +39,7 @@ int dsa_sign(int argc, char* argv[]) } std::string outfile = argv[2] + SUFFIX; - std::ofstream sigfile(outfile.c_str()); + std::ofstream sigfile(outfile); if(!sigfile) { std::cout << "Couldn't write the signature to " |