| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef MOJO_PUBLIC_BINDINGS_ARRAY_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_ |
| 6 #define MOJO_PUBLIC_BINDINGS_ARRAY_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_ |
| 7 | 7 |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "mojo/public/bindings/lib/array_internal.h" | 14 #include "mojo/public/bindings/lib/array_internal.h" |
| 15 #include "mojo/public/bindings/type_converter.h" | 15 #include "mojo/public/cpp/bindings/type_converter.h" |
| 16 | 16 |
| 17 namespace mojo { | 17 namespace mojo { |
| 18 | 18 |
| 19 // Provides read-only access to array data. | 19 // Provides read-only access to array data. |
| 20 template <typename T> | 20 template <typename T> |
| 21 class Array { | 21 class Array { |
| 22 public: | 22 public: |
| 23 typedef internal::ArrayTraits<T, internal::TypeTraits<T>::kIsObject> Traits_; | 23 typedef internal::ArrayTraits<T, internal::TypeTraits<T>::kIsObject> Traits_; |
| 24 typedef typename Traits_::DataType Data; | 24 typedef typename Traits_::DataType Data; |
| 25 typedef typename Traits_::ConstRef ConstRef; | 25 typedef typename Traits_::ConstRef ConstRef; |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 result.resize(input.size()); | 147 result.resize(input.size()); |
| 148 for (size_t i = 0; i < input.size(); ++i) | 148 for (size_t i = 0; i < input.size(); ++i) |
| 149 result[i] = TypeConverter<T, E>::ConvertTo(input[i]); | 149 result[i] = TypeConverter<T, E>::ConvertTo(input[i]); |
| 150 } | 150 } |
| 151 return result; | 151 return result; |
| 152 } | 152 } |
| 153 }; | 153 }; |
| 154 | 154 |
| 155 } // namespace mojo | 155 } // namespace mojo |
| 156 | 156 |
| 157 #endif // MOJO_PUBLIC_BINDINGS_ARRAY_H_ | 157 #endif // MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_ |
| OLD | NEW |