Made Vector have a size() function, to make it more STL-alike.

Bug: 17316346
Change-Id: I52377b7fa51adccadc4e867d45666e683bc2c1ae
Tested: on Linux.
This commit is contained in:
Wouter van Oortmerssen
2014-09-04 12:22:11 -07:00
parent 84f86be700
commit 96592d5dbb
2 changed files with 9 additions and 6 deletions

View File

@@ -70,7 +70,7 @@ template<typename T> void PrintVector(const Vector<T> &v, Type type,
std::string &text = *_text;
text += "[";
text += NewLine(opts);
for (uoffset_t i = 0; i < v.Length(); i++) {
for (uoffset_t i = 0; i < v.size(); i++) {
if (i) {
text += ",";
text += NewLine(opts);
@@ -91,7 +91,7 @@ template<typename T> void PrintVector(const Vector<T> &v, Type type,
static void EscapeString(const String &s, std::string *_text) {
std::string &text = *_text;
text += "\"";
for (uoffset_t i = 0; i < s.Length(); i++) {
for (uoffset_t i = 0; i < s.size(); i++) {
char c = s.Get(i);
switch (c) {
case '\n': text += "\\n"; break;