| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 //#include "ErrorSupport.h" | 5 //#include "ErrorSupport.h" |
| 6 | 6 |
| 7 {% for namespace in config.protocol.namespace %} | 7 {% for namespace in config.protocol.namespace %} |
| 8 namespace {{namespace}} { | 8 namespace {{namespace}} { |
| 9 {% endfor %} | 9 {% endfor %} |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 builder.append('.'); | 35 builder.append('.'); |
| 36 builder.append(m_path[i]); | 36 builder.append(m_path[i]); |
| 37 } | 37 } |
| 38 builder.append(": "); | 38 builder.append(": "); |
| 39 builder.append(error); | 39 builder.append(error); |
| 40 m_errors.push_back(builder.toString()); | 40 m_errors.push_back(builder.toString()); |
| 41 } | 41 } |
| 42 | 42 |
| 43 bool ErrorSupport::hasErrors() | 43 bool ErrorSupport::hasErrors() |
| 44 { | 44 { |
| 45 return m_errors.size(); | 45 return !!m_errors.size(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 String ErrorSupport::errors() | 48 String ErrorSupport::errors() |
| 49 { | 49 { |
| 50 StringBuilder builder; | 50 StringBuilder builder; |
| 51 for (size_t i = 0; i < m_errors.size(); ++i) { | 51 for (size_t i = 0; i < m_errors.size(); ++i) { |
| 52 if (i) | 52 if (i) |
| 53 builder.append("; "); | 53 builder.append("; "); |
| 54 builder.append(m_errors[i]); | 54 builder.append(m_errors[i]); |
| 55 } | 55 } |
| 56 return builder.toString(); | 56 return builder.toString(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 {% for namespace in config.protocol.namespace %} | 59 {% for namespace in config.protocol.namespace %} |
| 60 } // namespace {{namespace}} | 60 } // namespace {{namespace}} |
| 61 {% endfor %} | 61 {% endfor %} |
| OLD | NEW |