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

Side by Side Diff: base/android/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: Rename library 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CRAZY_LINKER_ERROR_H
6 #define CRAZY_LINKER_ERROR_H
7
8 namespace crazy {
9
10 // A class used to hold a fixed-size buffer to hold error messages
11 // as well as perform assignment and formatting.
12 //
13 // Usage examples:
14 // Error error;
15 // error = "Unimplemented feature";
16 // error->Set("Unimplemented feature");
17 // error->Format("Feature %s is not implemented", feature_name);
18 // error->Append(strerror(errno));
19 // error->AppendFormat("Error: %s", strerror(errno));
20 //
21 class Error {
22 public:
23 Error() {
24 buff_[0] = '\0';
25 }
26
27 Error(const char* message) {
28 Set(message);
29 }
30
31 Error(const Error& other) {
32 Set(other.buff_);
33 }
34
35 const char* c_str() const { return buff_; }
36
37 void Set(const char* message);
38
39 void Format(const char* fmt, ...);
40
41 void Append(const char* message);
42
43 void AppendFormat(const char* fmt, ...);
44
45 private:
46 char buff_[512];
47 };
48
49 } // namespace crazy
50
51 #endif // CRAZY_LINKER_ERROR_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698