2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 #ifndef TIZENAPIS_TIZEN_FILESYSTEM_CONVERTER_H_
20 #define TIZENAPIS_TIZEN_FILESYSTEM_CONVERTER_H_
25 #include <JavaScriptCore/JavaScript.h>
26 #include <CommonsJavaScript/Converter.h>
29 #include "INodeTypes.h"
30 #include "NodeFilter.h"
31 #include "StorageProperties.h"
35 namespace Filesystem {
36 class Converter : public WrtDeviceApis::CommonsJavaScript::Converter
39 using WrtDeviceApis::CommonsJavaScript::Converter::toJSValueRef;
42 explicit Converter(JSContextRef context);
46 JSValueRef toJSValueRef(
48 const JSFile::PrivateObjectDef::PermissionList &parentPermissions,
49 JSContextRef context);
50 JSValueRef toJSValueRef(unsigned char* data,
52 JSValueRef toJSValueRef(unsigned long long arg);
54 IPathPtr toPath(const JSValueRef& arg);
56 NodeFilterPtr toNodeFilter(const JSValueRef& arg);
58 AccessMode toAccessMode(const JSValueRef& arg);
60 std::string toEncoding(const JSValueRef& arg);
62 JSValueRef toStorageType(const short type);
63 JSValueRef toStorageState(const short state);
64 JSValueRef toJSValueRef(
65 const StoragePropertiesPtr &arg,
66 JSContextRef context);
68 JSValueRef toJSValueRef(
69 const std::vector<StoragePropertiesPtr>& arg,
70 JSContextRef context);
73 typedef WrtDeviceApis::CommonsJavaScript::ConverterFactory<Converter> ConverterFactory;
74 typedef ConverterFactory::ConverterType ConverterPtr;