Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(681)

Unified Diff: third_party/crazy_linker/crazy_linker/src/crazy_linker_error.h

Issue 23717023: Android: Add chrome-specific dynamic linker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove findbugs issues. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/crazy_linker/crazy_linker/src/crazy_linker_error.h
diff --git a/third_party/crazy_linker/crazy_linker/src/crazy_linker_error.h b/third_party/crazy_linker/crazy_linker/src/crazy_linker_error.h
new file mode 100644
index 0000000000000000000000000000000000000000..676e583bb455e1cc470c034f2178284c4cb774f7
--- /dev/null
+++ b/third_party/crazy_linker/crazy_linker/src/crazy_linker_error.h
@@ -0,0 +1,51 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CRAZY_LINKER_ERROR_H
+#define CRAZY_LINKER_ERROR_H
+
+namespace crazy {
+
+// A class used to hold a fixed-size buffer to hold error messages
+// as well as perform assignment and formatting.
+//
+// Usage examples:
+// Error error;
+// error = "Unimplemented feature";
+// error->Set("Unimplemented feature");
+// error->Format("Feature %s is not implemented", feature_name);
+// error->Append(strerror(errno));
+// error->AppendFormat("Error: %s", strerror(errno));
+//
+class Error {
+public:
+ Error() {
+ buff_[0] = '\0';
+ }
+
+ Error(const char* message) {
+ Set(message);
+ }
+
+ Error(const Error& other) {
+ Set(other.buff_);
+ }
+
+ const char* c_str() const { return buff_; }
+
+ void Set(const char* message);
+
+ void Format(const char* fmt, ...);
+
+ void Append(const char* message);
+
+ void AppendFormat(const char* fmt, ...);
+
+private:
+ char buff_[512];
+};
+
+} // namespace crazy
+
+#endif // CRAZY_LINKER_ERROR_H

Powered by Google App Engine
This is Rietveld 408576698