Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 41 static const char kCarriageReturn = '\r'; | 41 static const char kCarriageReturn = '\r'; |
| 42 } | 42 } |
| 43 | 43 |
| 44 TextReader::TextReader() { | 44 TextReader::TextReader() { |
| 45 } | 45 } |
| 46 | 46 |
| 47 TextReader::~TextReader() { | 47 TextReader::~TextReader() { |
| 48 } | 48 } |
| 49 | 49 |
| 50 int TextReader::TestForEndOfLine(const std::string& eol) { | 50 int TextReader::TestForEndOfLine(const std::string& eol) { |
| 51 if (eol.size() == 0) { | 51 if (eol.empty()) { |
|
Peter Kasting
2011/03/02 00:02:42
Nit: Eliminate anonymous namespace of consts and c
| |
| 52 return 0; | 52 return 0; |
| 53 } | 53 } |
| 54 if (eol[0] == kLinefeed) { | 54 if (eol[0] == kLinefeed) { |
| 55 return 1; | 55 return 1; |
| 56 } | 56 } |
| 57 if (eol[0] == kCarriageReturn) { | 57 if (eol[0] == kCarriageReturn) { |
| 58 if (eol.size() > 1 && eol[1] == kLinefeed) { | 58 if (eol.size() > 1 && eol[1] == kLinefeed) { |
| 59 return 2; | 59 return 2; |
| 60 } else { | 60 } else { |
| 61 return 1; | 61 return 1; |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 return 0; | 64 return 0; |
| 65 } | 65 } |
| 66 } // end namespace o3d | 66 } // end namespace o3d |
| OLD | NEW |