You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
874 B
49 lines
874 B
#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
|