Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cfgas_decimal.h
Go to the documentation of this file.
1// Copyright 2017 The PDFium Authors
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 XFA_FGAS_CRT_CFGAS_DECIMAL_H_
8#define XFA_FGAS_CRT_CFGAS_DECIMAL_H_
9
10#include "core/fxcrt/widestring.h"
11
13 public:
15 explicit CFGAS_Decimal(uint32_t val);
16 explicit CFGAS_Decimal(uint64_t val);
17 explicit CFGAS_Decimal(int32_t val);
18 CFGAS_Decimal(float val, uint8_t scale);
19 explicit CFGAS_Decimal(WideStringView str);
20
21 WideString ToWideString() const;
22 float ToFloat() const;
23 double ToDouble() const;
24
25 CFGAS_Decimal operator*(const CFGAS_Decimal& val) const;
26 CFGAS_Decimal operator/(const CFGAS_Decimal& val) const;
27
28 bool IsNotZero() const { return m_uHi || m_uMid || m_uLo; }
29 uint8_t GetScale() const { return m_uScale; }
30 void SetScale(uint8_t newScale);
31 void SetNegate();
32
33 private:
34 CFGAS_Decimal(uint32_t hi,
35 uint32_t mid,
36 uint32_t lo,
37 bool neg,
38 uint8_t scale);
39
40 uint32_t m_uHi = 0;
41 uint32_t m_uMid = 0;
42 uint32_t m_uLo = 0;
43 bool m_bNeg = false;
44 uint8_t m_uScale = 0;
45};
46
47#endif // XFA_FGAS_CRT_CFGAS_DECIMAL_H_
XFA_ResolveFlag
const FXJSE_CLASS_DESCRIPTOR kFormCalcDescriptor
bool IsNotZero() const
uint8_t GetScale() const
void SetScale(uint8_t newScale)
CFGAS_Decimal(uint64_t val)
CFGAS_Decimal(float val, uint8_t scale)
CFGAS_Decimal(WideStringView str)
CFGAS_Decimal operator*(const CFGAS_Decimal &val) const
CFGAS_Decimal(uint32_t val)
double ToDouble() const
WideString ToWideString() const
CFGAS_Decimal operator/(const CFGAS_Decimal &val) const
CFGAS_Decimal(int32_t val)
float ToFloat() const
XFA_SCRIPTATTRIBUTEINFO script_attribute
CXFA_Object * GetThisObject() const
friend class EventParamScope
v8::Local< v8::Value > GlobalPropertyGetter()
static ByteString Local2IsoDate(CFXJSE_HostObject *pThis, ByteStringView bsDate, ByteStringView bsFormat, ByteStringView bsLocale)
static ByteString Num2AllTime(CFXJSE_HostObject *pThis, int32_t iTime, ByteStringView bsFormat, ByteStringView bsLocale, bool bGM)
CXFA_Document * GetDocument() const
static ByteString GetStandardTimeFormat(CFXJSE_HostObject *pThis, int32_t iStyle, ByteStringView bsLocale)
static ByteString GetStandardDateFormat(CFXJSE_HostObject *pThis, int32_t iStyle, ByteStringView bsLocale)
CFXJSE_FormCalcContext * AsFormCalcContext() override
static ByteString GetLocalDateFormat(CFXJSE_HostObject *pThis, int32_t iStyle, ByteStringView bsLocale, bool bStandard)
~CFXJSE_FormCalcContext() override
CFXJSE_FormCalcContext(v8::Isolate *pIsolate, CFXJSE_Context *pScriptContext, CXFA_Document *pDoc)
static ByteString GetLocalTimeFormat(CFXJSE_HostObject *pThis, int32_t iStyle, ByteStringView bsLocale, bool bStandard)
static ByteString IsoDate2Local(CFXJSE_HostObject *pThis, ByteStringView bsDate, ByteStringView bsFormat, ByteStringView bsLocale)
static ByteString IsoTime2Local(CFXJSE_HostObject *pThis, ByteStringView bsTime, ByteStringView bsFormat, ByteStringView bsLocale)
virtual CFXJSE_FormCalcContext * AsFormCalcContext()
Definition fxjse.cpp:34
int32_t GetYear() const
uint8_t GetSecond() const
uint8_t GetHour() const
uint8_t GetDay() const
uint8_t GetMinute() const
uint16_t GetMillisecond() const
uint8_t GetMonth() const
CXFA_FFNotify * GetNotify() const
CXFA_LocaleMgr * GetLocaleMgr()
CFXJSE_Engine * GetScriptContext() const
virtual bool PostRequestURL(const WideString &wsURL, const WideString &wsData, const WideString &wsContentType, const WideString &wsEncode, const WideString &wsHeader, WideString &wsResponse)=0
virtual bool PutRequestURL(const WideString &wsURL, const WideString &wsData, const WideString &wsEncode)=0
CXFA_FFApp::CallbackIface * GetAppProvider()
CXFA_FMParser(cppgc::Heap *heap, CXFA_FMLexer *pLexer)
CXFA_FMAST * Parse()
GCedLocaleIface * GetDefLocale() override
GCedLocaleIface * GetLocaleByName(const WideString &wsLocaleName) override
CXFA_LocaleValue(ValueType dwType, const WideString &wsValue, const WideString &wsFormat, GCedLocaleIface *pLocale, CXFA_LocaleMgr *pLocaleMgr)
double GetDoubleNum() const
CFX_DateTime GetTime() const
const WideString & GetValue() const
CFX_DateTime GetDate() const
bool FormatPatterns(WideString &wsResult, const WideString &wsFormat, GCedLocaleIface *pLocale, XFA_ValuePicture eValueType) const
bool IsValid() const
GCedLocaleIface * GetLocale()
CXFA_Node * AsNode()
virtual WideString GetDatePattern(DateTimeSubcategory eType) const =0
virtual int GetTimeZoneInMinutes() const =0
virtual WideString GetDateTimeSymbols() const =0
virtual WideString GetTimePattern(DateTimeSubcategory eType) const =0
ByteString(const char *ptr)
bool EqualNoCase(ByteStringView str) const
static ByteString Format(const char *pFormat,...)
ByteString & operator+=(const ByteString &str)
ByteString & operator+=(char ch)
static ByteString FormatInteger(int i)
bool operator==(const ByteString &other) const
bool operator==(const char *ptr) const
ByteString & operator+=(const char *str)
const char * c_str() const
Definition bytestring.h:76
ByteString & operator=(const ByteString &that)
bool IsEmpty() const
Definition bytestring.h:119
int Compare(ByteStringView str) const
ByteString ToUTF8() const
WideString & operator=(WideString &&that) noexcept
static WideString FromUTF8(ByteStringView str)
CharType operator[](const size_t index) const
Definition widestring.h:146
bool IsEmpty() const
Definition widestring.h:118
const wchar_t * c_str() const
Definition widestring.h:81
WideString(const wchar_t *ptr)
bool IsASCII() const
Definition widestring.h:215
ByteString ToASCII() const
static WideString FromASCII(ByteStringView str)
void AppendChar(wchar_t wch)
WideString MakeString() const
WideStringView AsStringView() const
XFA_ValuePicture
Definition cxfa_node.h:70
CXFA_Node * ToNode(CXFA_Object *pObj)
time_t FXSYS_time(time_t *tloc)
int FXSYS_WideHexCharToInt(wchar_t c)
bool FXSYS_IsDecimalDigit(wchar_t c)
bool FXSYS_IsWideHexDigit(wchar_t c)
struct tm * FXSYS_localtime(const time_t *tp)
void FX_Random_GenerateMT(uint32_t *pBuffer, int32_t iCount)
int32_t FXSYS_atoi(const char *str)
#define FX_FILESIZE
Definition fx_types.h:19
XFA_Attribute
Definition fxfa_basic.h:67
XFA_ScriptType
Definition fxfa_basic.h:104
Definition heap.h:12
ByteString operator+(const ByteString &str1, const ByteString &str2)
Definition bytestring.h:270
WideString operator+(const WideString &str1, const WideString &str2)
Definition widestring.h:269
ByteString operator+(const ByteString &str1, const char *str2)
Definition bytestring.h:279
WideString operator+(const wchar_t *str1, const WideString &str2)
Definition widestring.h:281
WideString operator+(const WideString &str1, const wchar_t *str2)
Definition widestring.h:278
Definition fxv8.h:22
bool IsBoolean(v8::Local< v8::Value > value)
Definition fxv8.cpp:27
bool IsArray(v8::Local< v8::Value > value)
Definition fxv8.cpp:47
bool IsUndefined(v8::Local< v8::Value > value)
Definition fxv8.cpp:19
bool IsNumber(v8::Local< v8::Value > value)
Definition fxv8.cpp:35
bool IsObject(v8::Local< v8::Value > value)
Definition fxv8.cpp:43
bool IsString(v8::Local< v8::Value > value)
Definition fxv8.cpp:31
ByteString ReentrantToByteStringHelper(v8::Isolate *pIsolate, v8::Local< v8::Value > pValue)
Definition fxv8.cpp:173
bool ReentrantToBooleanHelper(v8::Isolate *pIsolate, v8::Local< v8::Value > pValue)
Definition fxv8.cpp:138
bool IsNull(v8::Local< v8::Value > value)
Definition fxv8.cpp:23
int32_t ReentrantToInt32Helper(v8::Isolate *pIsolate, v8::Local< v8::Value > pValue)
Definition fxv8.cpp:131
const char kClassTag[]
Definition fxjse.cpp:18
const char kFuncTag[]
Definition fxjse.cpp:17
XFA_ScriptType eValueType
XFA_ATTRIBUTE_CALLBACK callback