2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #ifndef TIZENAPIS_TIZEN_FILESYSTEM_CONVERTER_H_
19 #define TIZENAPIS_TIZEN_FILESYSTEM_CONVERTER_H_
24 #include <JavaScriptCore/JavaScript.h>
25 #include <CommonsJavaScript/Converter.h>
26 #include <API/Filesystem/Enums.h>
27 #include <API/Filesystem/IPath.h>
28 #include <API/Filesystem/INodeTypes.h>
29 #include <API/Filesystem/NodeFilter.h>
30 #include <API/Filesystem/StorageProperties.h>
34 class Converter : public WrtDeviceApis::CommonsJavaScript::Converter
37 using WrtDeviceApis::CommonsJavaScript::Converter::toJSValueRef;
40 explicit Converter(JSContextRef context);
42 JSValueRef toJSValueRef(
43 const Api::Filesystem::StoragePropertiesPtr &arg,
44 JSContextRef context);
46 JSValueRef toJSValueRef(
47 const std::vector<Api::Filesystem::StoragePropertiesPtr>& arg,
48 JSContextRef context);
50 JSValueRef toJSValueRef(const Api::Filesystem::NodeList& arg,
51 JSContextRef context);
53 JSValueRef toJSValueRef(unsigned char* data,
56 Api::Filesystem::IPathPtr toPath(const JSValueRef& arg);
58 Api::Filesystem::NodeFilterPtr toNodeFilter(const JSValueRef& arg);
60 Api::Filesystem::AccessMode toAccessMode(const JSValueRef& arg);
62 std::string toEncoding(const JSValueRef& arg);
64 JSValueRef toStorageType(const short type);
65 JSValueRef toStorageState(const short state);
68 typedef WrtDeviceApis::CommonsJavaScript::ConverterFactory<Converter> ConverterFactory;
69 typedef ConverterFactory::ConverterType ConverterPtr;