|
size_t | Read (void *buff, size_t size) |
| Reads "size" bytes to buff from file, buff should be pre-allocated.
|
|
void | ReadOrDie (void *buff, size_t size) |
|
char * | ReadLine (char *output, uint64_t max_length) |
|
int64_t | ReadToString (std::string *line, uint64_t max_length) |
|
size_t | Write (const void *buff, size_t size) |
| Writes "size" bytes of buff to file, buff should be pre-allocated.
|
|
void | WriteOrDie (const void *buff, size_t size) |
|
size_t | WriteString (absl::string_view str) |
| Writes a string to file.
|
|
bool | WriteLine (absl::string_view line) |
| Writes a string to file and append a "\n".
|
|
bool | Close () |
| Closes the file.
|
|
absl::Status | Close (int flags) |
| Deletes "this" on closing.
|
|
bool | Flush () |
| Flushes buffer.
|
|
size_t | Size () |
| Returns file size.
|
|
absl::string_view | filename () const |
| Returns the file name.
|
|
bool | Open () const |
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. This file defines some IO interfaces for compatibility with Google IO specifications.
Definition at line 30 of file file.h.
File * File::Open |
( |
absl::string_view | filename, |
|
|
absl::string_view | mode ) |
|
static |
Opens file "name" with flags specified by "mode". Flags are defined by fopen(), that is "r", "r+", "w", "w+". "a", and "a+". The caller should free the File after closing it by passing the returned pointer to delete.
Definition at line 116 of file file.cc.