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 _UTIL_H_
8#define _UTIL_H_
9
10class util : public CJS_EmbedObj
11{
12public:
13	util(CJS_Object * pJSObject);
14	virtual ~util(void);
15
16public:
17	FX_BOOL printd(OBJ_METHOD_PARAMS);
18	FX_BOOL printf(OBJ_METHOD_PARAMS);
19	FX_BOOL printx(OBJ_METHOD_PARAMS);
20	FX_BOOL scand(OBJ_METHOD_PARAMS);
21	FX_BOOL byteToChar(OBJ_METHOD_PARAMS);
22
23public:
24	static void		printd(const std::wstring &cFormat,CJS_Date Date,bool bXFAPicture, std::wstring &cPurpose);
25	static void		printx(const std::string &cFormat,const std::string &cSource, std::string &cPurpose);
26	static int		ParstDataType(std::wstring* sFormat);
27};
28
29class CJS_Util : public CJS_Object
30{
31public:
32	CJS_Util(JSFXObject  pObject) : CJS_Object(pObject) {};
33	virtual ~CJS_Util(void){};
34
35	DECLARE_JS_CLASS(CJS_Util);
36
37	JS_STATIC_METHOD(printd, util);
38	JS_STATIC_METHOD(printf, util);
39	JS_STATIC_METHOD(printx, util);
40	JS_STATIC_METHOD(scand, util);
41	JS_STATIC_METHOD(byteToChar, util);
42};
43
44FX_INT64 FX_atoi64(const char *nptr);
45#endif //_UTIL_H_
46