Chih-Hung Hsieh 93561ab3b9 Fix/suppress tools google-explicit-constructor warnings
* Add explicit to conversion constructors/operators
* Remove redundant explicit of copy constructors

Bug: 28341362
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,google-explicit-constructor
Change-Id: Ic11c22c59beb7aa32b878a23315b1036ca4e3c6a
2019-01-10 19:52:49 +00:00

49 lines
874 B
C++

#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