#include <ctype.h>
#include <stddef.h>
-#include <iostream>
#include <limits>
#include <map>
#include <string>
#include "phonenumbers/regexp_adapter_re2.h"
#endif // I18N_PHONENUMBERS_USE_RE2_AND_ICU
-using std::cerr;
-using std::endl;
using std::make_pair;
using std::map;
using std::numeric_limits;
#if defined(I18N_PHONENUMBERS_USE_ALTERNATE_FORMATS)
if (!alternate_formats->ParseFromArray(alternate_format_get(),
alternate_format_size())) {
- cerr << "Could not parse binary data." << endl;
+ LOG(ERROR) << "Could not parse binary data.";
return false;
}
return true;
#include "phonenumbers/phonenumberutil.h"
-#include <string.h>
#include <algorithm>
#include <cctype>
-#include <fstream>
-#include <iostream>
+#include <cstring>
#include <iterator>
#include <map>
-#include <sstream>
#include <utility>
#include <vector>
namespace i18n {
namespace phonenumbers {
-using std::cerr;
-using std::endl;
-using std::ifstream;
using std::make_pair;
using std::sort;
-using std::stringstream;
using google::protobuf::RepeatedPtrField;
bool LoadCompiledInMetadata(PhoneMetadataCollection* metadata) {
if (!metadata->ParseFromArray(metadata_get(), metadata_size())) {
- cerr << "Could not parse binary data." << endl;
+ LOG(ERROR) << "Could not parse binary data.";
return false;
}
return true;
// Author: Jim Meehan
-#include <iostream>
+#include <algorithm>
#include <sstream>
#include <cassert>
+#include <cstdio>
#include "phonenumbers/utf/unicodetext.h"
#include "phonenumbers/utf/stringpiece.h"
using std::max;
using std::hex;
using std::dec;
-using std::cerr;
-using std::endl;
static int CodepointDistance(const char* start, const char* end) {
int n = 0;
UnicodeText& UnicodeText::CopyUTF8(const char* buffer, int byte_length) {
repr_.Copy(buffer, byte_length);
if (!UniLib:: IsInterchangeValid(buffer, byte_length)) {
- cerr << "UTF-8 buffer is not interchange-valid." << endl;
+ fprintf(stderr, "UTF-8 buffer is not interchange-valid.\n");
repr_.size_ = ConvertToInterchangeValid(repr_.data_, byte_length);
}
return *this;
int byte_capacity) {
repr_.TakeOwnershipOf(buffer, byte_length, byte_capacity);
if (!UniLib:: IsInterchangeValid(buffer, byte_length)) {
- cerr << "UTF-8 buffer is not interchange-valid." << endl;
+ fprintf(stderr, "UTF-8 buffer is not interchange-valid.\n");
repr_.size_ = ConvertToInterchangeValid(repr_.data_, byte_length);
}
return *this;
if (UniLib:: IsInterchangeValid(buffer, byte_length)) {
repr_.PointTo(buffer, byte_length);
} else {
- cerr << "UTF-8 buffer is not interchange-valid." << endl;
+ fprintf(stderr, "UTF-8 buffer is not interchange-valid.");
repr_.Copy(buffer, byte_length);
repr_.size_ = ConvertToInterchangeValid(repr_.data_, byte_length);
}
if (UniLib::IsInterchangeValid(buf, len)) {
repr_.append(buf, len);
} else {
- cerr << "Unicode value 0x" << hex << c
- << " is not valid for interchange" << endl;
+ fprintf(stderr, "Unicode value 0x%x is not valid for interchange\n", c);
repr_.append(" ", 1);
}
} else {
- cerr << "Illegal Unicode value: 0x" << hex << c << endl;
+ fprintf(stderr, "Illegal Unicode value: 0x%x\n", c);
repr_.append(" ", 1);
}
}