Rename Error -> Status.
This renames the LLDB error class to Status, as discussed
on the lldb-dev mailing list.
A change of this magnitude cannot easily be done without
find and replace, but that has potential to catch unwanted
occurrences of common strings such as "Error". Every effort
was made to find all the obvious things such as the word "Error"
appearing in a string, etc, but it's possible there are still
some lingering occurences left around. Hopefully nothing too
serious.
llvm-svn: 302872
diff --git a/lldb/source/Host/common/File.cpp b/lldb/source/Host/common/File.cpp
index 1869a6d..3de93eb 100644
--- a/lldb/source/Host/common/File.cpp
+++ b/lldb/source/Host/common/File.cpp
@@ -157,8 +157,8 @@
m_own_stream = transfer_ownership;
}
-Error File::Open(const char *path, uint32_t options, uint32_t permissions) {
- Error error;
+Status File::Open(const char *path, uint32_t options, uint32_t permissions) {
+ Status error;
if (IsValid())
Close();
@@ -246,20 +246,20 @@
return error;
}
-uint32_t File::GetPermissions(const FileSpec &file_spec, Error &error) {
+uint32_t File::GetPermissions(const FileSpec &file_spec, Status &error) {
if (file_spec) {
error.Clear();
auto Perms = llvm::sys::fs::getPermissions(file_spec.GetPath());
if (Perms)
return *Perms;
- error = Error(Perms.getError());
+ error = Status(Perms.getError());
return 0;
} else
error.SetErrorString("empty file spec");
return 0;
}
-uint32_t File::GetPermissions(Error &error) const {
+uint32_t File::GetPermissions(Status &error) const {
int fd = GetDescriptor();
if (fd != kInvalidDescriptor) {
struct stat file_stats;
@@ -275,8 +275,8 @@
return 0;
}
-Error File::Close() {
- Error error;
+Status File::Close() {
+ Status error;
if (StreamIsValid() && m_own_stream) {
if (::fclose(m_stream) == EOF)
error.SetErrorToErrno();
@@ -305,8 +305,8 @@
eLazyBoolCalculate;
}
-Error File::GetFileSpec(FileSpec &file_spec) const {
- Error error;
+Status File::GetFileSpec(FileSpec &file_spec) const {
+ Status error;
#ifdef F_GETPATH
if (IsValid()) {
char path[PATH_MAX];
@@ -340,7 +340,7 @@
return error;
}
-off_t File::SeekFromStart(off_t offset, Error *error_ptr) {
+off_t File::SeekFromStart(off_t offset, Status *error_ptr) {
off_t result = 0;
if (DescriptorIsValid()) {
result = ::lseek(m_descriptor, offset, SEEK_SET);
@@ -366,7 +366,7 @@
return result;
}
-off_t File::SeekFromCurrent(off_t offset, Error *error_ptr) {
+off_t File::SeekFromCurrent(off_t offset, Status *error_ptr) {
off_t result = -1;
if (DescriptorIsValid()) {
result = ::lseek(m_descriptor, offset, SEEK_CUR);
@@ -392,7 +392,7 @@
return result;
}
-off_t File::SeekFromEnd(off_t offset, Error *error_ptr) {
+off_t File::SeekFromEnd(off_t offset, Status *error_ptr) {
off_t result = -1;
if (DescriptorIsValid()) {
result = ::lseek(m_descriptor, offset, SEEK_END);
@@ -418,8 +418,8 @@
return result;
}
-Error File::Flush() {
- Error error;
+Status File::Flush() {
+ Status error;
if (StreamIsValid()) {
int err = 0;
do {
@@ -434,8 +434,8 @@
return error;
}
-Error File::Sync() {
- Error error;
+Status File::Sync() {
+ Status error;
if (DescriptorIsValid()) {
#ifdef _WIN32
int err = FlushFileBuffers((HANDLE)_get_osfhandle(m_descriptor));
@@ -462,8 +462,8 @@
#define MAX_WRITE_SIZE INT_MAX
#endif
-Error File::Read(void *buf, size_t &num_bytes) {
- Error error;
+Status File::Read(void *buf, size_t &num_bytes) {
+ Status error;
#if defined(MAX_READ_SIZE)
if (num_bytes > MAX_READ_SIZE) {
@@ -524,8 +524,8 @@
return error;
}
-Error File::Write(const void *buf, size_t &num_bytes) {
- Error error;
+Status File::Write(const void *buf, size_t &num_bytes) {
+ Status error;
#if defined(MAX_WRITE_SIZE)
if (num_bytes > MAX_WRITE_SIZE) {
@@ -588,8 +588,8 @@
return error;
}
-Error File::Read(void *buf, size_t &num_bytes, off_t &offset) {
- Error error;
+Status File::Read(void *buf, size_t &num_bytes, off_t &offset) {
+ Status error;
#if defined(MAX_READ_SIZE)
if (num_bytes > MAX_READ_SIZE) {
@@ -650,9 +650,9 @@
return error;
}
-Error File::Read(size_t &num_bytes, off_t &offset, bool null_terminate,
- DataBufferSP &data_buffer_sp) {
- Error error;
+Status File::Read(size_t &num_bytes, off_t &offset, bool null_terminate,
+ DataBufferSP &data_buffer_sp) {
+ Status error;
if (num_bytes > 0) {
int fd = GetDescriptor();
@@ -694,8 +694,8 @@
return error;
}
-Error File::Write(const void *buf, size_t &num_bytes, off_t &offset) {
- Error error;
+Status File::Write(const void *buf, size_t &num_bytes, off_t &offset) {
+ Status error;
#if defined(MAX_WRITE_SIZE)
if (num_bytes > MAX_WRITE_SIZE) {