OLD | NEW |
| (Empty) |
1 // Copyright 2014 PDFium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | |
6 | |
7 #ifndef FPDFSDK_SRC_JAVASCRIPT_UTIL_H_ | |
8 #define FPDFSDK_SRC_JAVASCRIPT_UTIL_H_ | |
9 | |
10 #include <string> | |
11 #include <vector> | |
12 | |
13 #include "fpdfsdk/src/javascript/JS_Define.h" | |
14 | |
15 class util : public CJS_EmbedObj { | |
16 public: | |
17 util(CJS_Object* pJSObject); | |
18 ~util() override; | |
19 | |
20 public: | |
21 FX_BOOL printd(IJS_Context* cc, | |
22 const std::vector<CJS_Value>& params, | |
23 CJS_Value& vRet, | |
24 CFX_WideString& sError); | |
25 FX_BOOL printf(IJS_Context* cc, | |
26 const std::vector<CJS_Value>& params, | |
27 CJS_Value& vRet, | |
28 CFX_WideString& sError); | |
29 FX_BOOL printx(IJS_Context* cc, | |
30 const std::vector<CJS_Value>& params, | |
31 CJS_Value& vRet, | |
32 CFX_WideString& sError); | |
33 FX_BOOL scand(IJS_Context* cc, | |
34 const std::vector<CJS_Value>& params, | |
35 CJS_Value& vRet, | |
36 CFX_WideString& sError); | |
37 FX_BOOL byteToChar(IJS_Context* cc, | |
38 const std::vector<CJS_Value>& params, | |
39 CJS_Value& vRet, | |
40 CFX_WideString& sError); | |
41 | |
42 public: | |
43 static void printd(const std::wstring& cFormat, | |
44 CJS_Date Date, | |
45 bool bXFAPicture, | |
46 std::wstring& cPurpose); | |
47 static void printx(const std::string& cFormat, | |
48 const std::string& cSource, | |
49 std::string& cPurpose); | |
50 static int ParstDataType(std::wstring* sFormat); | |
51 }; | |
52 | |
53 class CJS_Util : public CJS_Object { | |
54 public: | |
55 CJS_Util(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} | |
56 ~CJS_Util() override {} | |
57 | |
58 DECLARE_JS_CLASS(); | |
59 | |
60 JS_STATIC_METHOD(printd, util); | |
61 JS_STATIC_METHOD(printf, util); | |
62 JS_STATIC_METHOD(printx, util); | |
63 JS_STATIC_METHOD(scand, util); | |
64 JS_STATIC_METHOD(byteToChar, util); | |
65 }; | |
66 | |
67 #endif // FPDFSDK_SRC_JAVASCRIPT_UTIL_H_ | |
OLD | NEW |