File: Errors.h

package info (click to toggle)
android-platform-frameworks-base 1%3A10.0.0%2Br36-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 321,788 kB
  • sloc: java: 962,234; cpp: 274,314; xml: 242,770; python: 5,060; sh: 1,432; ansic: 494; makefile: 47; sed: 19
file content (48 lines) | stat: -rw-r--r-- 874 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <stdio.h>

#include <string>
#include <vector>

namespace android {
namespace stream_proto {

using namespace std;

struct Error
{
    Error();
    Error(const Error& that);
    Error(const string& filename, int lineno, const char* message);

    string filename;
    int lineno;
    string message;
};

class Errors
{
public:
    Errors();
    ~Errors();

    // Add an error
    void Add(const string& filename, int lineno, const char* format, ...);

    // Print the errors to stderr if there are any.
    void Print() const;

    bool HasErrors() const;

private:
    // The errors that have been added
    vector<Error> m_errors;
    void AddImpl(const string& filename, int lineno, const char* format, va_list ap);
};

extern Errors ERRORS;
extern const string UNKNOWN_FILE;
extern const int UNKNOWN_LINE;


} // namespace stream_proto
} // namespace android