buffet: Remove 'chromeos' namespace and move everything to buffet NS
As discussed, moved all the classes out of chromeos namespace into
'buffet.
Also fixed a number of cpplint's warnings.
BUG=None
TEST=Everything still compiles and unit tests succeed.
Change-Id: Ide864acb2504627404966727f66d353af60e531d
Reviewed-on: https://chromium-review.googlesource.com/198971
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
diff --git a/buffet/data_encoding.cc b/buffet/data_encoding.cc
index 0049193..9f351de 100644
--- a/buffet/data_encoding.cc
+++ b/buffet/data_encoding.cc
@@ -23,16 +23,16 @@
return dec;
}
-} // namespace
+} // namespace
/////////////////////////////////////////////////////////////////////////
-namespace chromeos {
+namespace buffet {
namespace data_encoding {
std::string UrlEncode(const char* data, bool encodeSpaceAsPlus) {
std::string result;
- while(*data) {
+ while (*data) {
char c = *data++;
// According to RFC3986 (http://www.faqs.org/rfcs/rfc3986.html),
// section 2.3. - Unreserved Characters
@@ -47,7 +47,8 @@
// 'application/x-www-form-urlencoded'
result += '+';
} else {
- base::StringAppendF(&result, "%%%02X", (unsigned char)c); // Encode as %NN
+ base::StringAppendF(&result, "%%%02X",
+ static_cast<unsigned char>(c)); // Encode as %NN
}
}
return result;
@@ -62,7 +63,7 @@
// so it is safe to access data[0] and data[1] without overrunning the buf.
if (c == '%' &&
(part1 = HexToDec(data[0])) >= 0 && (part2 = HexToDec(data[1])) >= 0) {
- c = char((part1 << 4) | part2);
+ c = static_cast<char>((part1 << 4) | part2);
data += 2;
} else if (c == '+') {
c = ' ';
@@ -96,5 +97,5 @@
return result;
}
-} // namespace data_encoding
-} // namespace chromeos
+} // namespace data_encoding
+} // namespace buffet