OLD | NEW |
| (Empty) |
1 // Copyright 2010 The Ginsu Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can | |
3 // be found in the LICENSE file. | |
4 | |
5 #ifndef C_SALT_NPAPI_VARIANT_CONVERTER_H_ | |
6 #define C_SALT_NPAPI_VARIANT_CONVERTER_H_ | |
7 | |
8 #include <nacl/npruntime.h> | |
9 | |
10 #include "c_salt/variant_ptrs.h" | |
11 | |
12 namespace c_salt { | |
13 | |
14 namespace npapi { | |
15 | |
16 // VariantConverter is a class that knows how to convert NPVariants to and | |
17 // from c_salt::Variants. | |
18 class VariantConverter { | |
19 public: | |
20 explicit VariantConverter(NPP instance); | |
21 | |
22 SharedVariant CreateVariantFromNPVariant(const NPVariant& np_var) const; | |
23 void ConvertVariantToNPVariant(const c_salt::Variant& c_salt_var, | |
24 NPVariant* np_var) const; | |
25 private: | |
26 NPP instance_; | |
27 }; | |
28 | |
29 } // namespace npapi | |
30 } // namespace c_salt | |
31 | |
32 #endif // C_SALT_NPAPI_VARIANT_CONVERTER_H_ | |
OLD | NEW |