diff options
author | Yoshiya Hinosawa <stibium121@gmail.com> | 2018-08-19 16:44:10 +0900 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-08-19 11:27:47 -0400 |
commit | aaabc853e84a03f72208c0e80634bd986c3ca4e2 (patch) | |
tree | 24cb4daf07c7b52b9260e041289ab2e79f25f5a8 /src/file_util.cc | |
parent | 146bc93b81ef1775a3a22784c74cbf0c8bbd1c9e (diff) |
chore: move libdeno files to //libdeno/
Diffstat (limited to 'src/file_util.cc')
-rw-r--r-- | src/file_util.cc | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/src/file_util.cc b/src/file_util.cc deleted file mode 100644 index a0cae5f58..000000000 --- a/src/file_util.cc +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2018 the Deno authors. All rights reserved. MIT license. -#include <inttypes.h> -#include <stdio.h> -#include <fstream> -#include <iterator> -#include <string> - -#include "file_util.h" - -namespace deno { - -bool ReadFileToString(const char* fn, std::string* contents) { - std::ifstream file(fn, std::ios::binary); - if (file.fail()) { - return false; - } - contents->assign(std::istreambuf_iterator<char>{file}, {}); - return !file.fail(); -} - -std::string Basename(std::string const& filename) { - for (auto it = filename.rbegin(); it != filename.rend(); ++it) { - char ch = *it; - if (ch == '\\' || ch == '/') { - return std::string(it.base(), filename.end()); - } - } - return filename; -} - -} // namespace deno |