From b048f791a15f2da781a01eba5b09eb9d389f9c11 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Tue, 4 Aug 2015 12:19:10 -0700 Subject: clang-format all pdfium code. No behavior change. Generated by: find . -name '*.cpp' -o -name '*.h' | \ grep -E -v 'third_party|thirdparties|lpng_v163' | \ xargs ../../buildtools/mac/clang-format -i See thread "tabs vs spaces" on pdfium@googlegroups.com for discussion. BUG=none R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1265503005 . --- fpdfsdk/include/javascript/JS_GlobalData.h | 143 +++++++++++++++-------------- 1 file changed, 74 insertions(+), 69 deletions(-) (limited to 'fpdfsdk/include/javascript/JS_GlobalData.h') diff --git a/fpdfsdk/include/javascript/JS_GlobalData.h b/fpdfsdk/include/javascript/JS_GlobalData.h index b3637b93d5..607eec79bd 100644 --- a/fpdfsdk/include/javascript/JS_GlobalData.h +++ b/fpdfsdk/include/javascript/JS_GlobalData.h @@ -9,89 +9,94 @@ #include "../../../core/include/fxcrt/fx_basic.h" -#define JS_GLOBALDATA_TYPE_NUMBER 0 -#define JS_GLOBALDATA_TYPE_BOOLEAN 1 -#define JS_GLOBALDATA_TYPE_STRING 2 -#define JS_GLOBALDATA_TYPE_OBJECT 3 -#define JS_GLOBALDATA_TYPE_NULL 4 +#define JS_GLOBALDATA_TYPE_NUMBER 0 +#define JS_GLOBALDATA_TYPE_BOOLEAN 1 +#define JS_GLOBALDATA_TYPE_STRING 2 +#define JS_GLOBALDATA_TYPE_OBJECT 3 +#define JS_GLOBALDATA_TYPE_NULL 4 class CJS_KeyValue; class CPDFDoc_Environment; -class CJS_GlobalVariableArray -{ -public: - CJS_GlobalVariableArray(); - virtual ~CJS_GlobalVariableArray(); +class CJS_GlobalVariableArray { + public: + CJS_GlobalVariableArray(); + virtual ~CJS_GlobalVariableArray(); - void Add(CJS_KeyValue* p); - int Count() const; - CJS_KeyValue* GetAt(int index) const; - void Copy(const CJS_GlobalVariableArray& array); + void Add(CJS_KeyValue* p); + int Count() const; + CJS_KeyValue* GetAt(int index) const; + void Copy(const CJS_GlobalVariableArray& array); - void Empty(); + void Empty(); -private: - CFX_ArrayTemplate array; + private: + CFX_ArrayTemplate array; }; -class CJS_KeyValue -{ -public: - CJS_KeyValue(){} - virtual ~CJS_KeyValue(){} - - CFX_ByteString sKey; - int nType; //0:int 1:bool 2:string 3:obj - double dData; - bool bData; - CFX_ByteString sData; - CJS_GlobalVariableArray objData; +class CJS_KeyValue { + public: + CJS_KeyValue() {} + virtual ~CJS_KeyValue() {} + + CFX_ByteString sKey; + int nType; // 0:int 1:bool 2:string 3:obj + double dData; + bool bData; + CFX_ByteString sData; + CJS_GlobalVariableArray objData; }; -class CJS_GlobalData_Element -{ -public: - CJS_GlobalData_Element(){} - virtual ~CJS_GlobalData_Element(){} +class CJS_GlobalData_Element { + public: + CJS_GlobalData_Element() {} + virtual ~CJS_GlobalData_Element() {} - CJS_KeyValue data; - FX_BOOL bPersistent; + CJS_KeyValue data; + FX_BOOL bPersistent; }; -class CJS_GlobalData -{ -public: - CJS_GlobalData(CPDFDoc_Environment* pApp); - virtual ~CJS_GlobalData(); - -public: - void SetGlobalVariableNumber(const FX_CHAR* propname, double dData); - void SetGlobalVariableBoolean(const FX_CHAR* propname, bool bData); - void SetGlobalVariableString(const FX_CHAR* propname, const CFX_ByteString& sData); - void SetGlobalVariableObject(const FX_CHAR* propname, const CJS_GlobalVariableArray& array); - void SetGlobalVariableNull(const FX_CHAR* propname); - - FX_BOOL SetGlobalVariablePersistent(const FX_CHAR* propname, FX_BOOL bPersistent); - FX_BOOL DeleteGlobalVariable(const FX_CHAR* propname); - - int32_t GetSize() const; - CJS_GlobalData_Element* GetAt(int index) const; - -private: - void LoadGlobalPersistentVariables(); - void SaveGlobalPersisitentVariables(); - - CJS_GlobalData_Element* GetGlobalVariable(const FX_CHAR* propname); - int FindGlobalVariable(const FX_CHAR* propname); - - void LoadFileBuffer(const FX_WCHAR* sFilePath, uint8_t*& pBuffer, int32_t& nLength); - void WriteFileBuffer(const FX_WCHAR* sFilePath, const FX_CHAR* pBuffer, int32_t nLength); - void MakeByteString(const CFX_ByteString& name, CJS_KeyValue* pData, CFX_BinaryBuf& sData); - -private: - CFX_ArrayTemplate m_arrayGlobalData; - CFX_WideString m_sFilePath; +class CJS_GlobalData { + public: + CJS_GlobalData(CPDFDoc_Environment* pApp); + virtual ~CJS_GlobalData(); + + public: + void SetGlobalVariableNumber(const FX_CHAR* propname, double dData); + void SetGlobalVariableBoolean(const FX_CHAR* propname, bool bData); + void SetGlobalVariableString(const FX_CHAR* propname, + const CFX_ByteString& sData); + void SetGlobalVariableObject(const FX_CHAR* propname, + const CJS_GlobalVariableArray& array); + void SetGlobalVariableNull(const FX_CHAR* propname); + + FX_BOOL SetGlobalVariablePersistent(const FX_CHAR* propname, + FX_BOOL bPersistent); + FX_BOOL DeleteGlobalVariable(const FX_CHAR* propname); + + int32_t GetSize() const; + CJS_GlobalData_Element* GetAt(int index) const; + + private: + void LoadGlobalPersistentVariables(); + void SaveGlobalPersisitentVariables(); + + CJS_GlobalData_Element* GetGlobalVariable(const FX_CHAR* propname); + int FindGlobalVariable(const FX_CHAR* propname); + + void LoadFileBuffer(const FX_WCHAR* sFilePath, + uint8_t*& pBuffer, + int32_t& nLength); + void WriteFileBuffer(const FX_WCHAR* sFilePath, + const FX_CHAR* pBuffer, + int32_t nLength); + void MakeByteString(const CFX_ByteString& name, + CJS_KeyValue* pData, + CFX_BinaryBuf& sData); + + private: + CFX_ArrayTemplate m_arrayGlobalData; + CFX_WideString m_sFilePath; }; #endif // FPDFSDK_INCLUDE_JAVASCRIPT_JS_GLOBALDATA_H_ -- cgit v1.2.3