diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-03-29 14:52:40 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-03-29 20:29:31 +0000 |
commit | bd5176ef75d850fd6a59bbd1fd5bebf1f2c8140f (patch) | |
tree | ab777fc3d52570bf08991998b2f16931a179c1b4 /xfa/fgas/localization/cfx_decimal.h | |
parent | ca825d3abded0dd633857ab56288ceff54858cd8 (diff) | |
download | pdfium-bd5176ef75d850fd6a59bbd1fd5bebf1f2c8140f.tar.xz |
Rename fgas/localization files to match contents
This Cl renames the files to match their contents and splits out headers
where needed.
Change-Id: Ibe2e90ca969a9d05ee73bb956ffa59a63c7ab076
Reviewed-on: https://pdfium-review.googlesource.com/3256
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fgas/localization/cfx_decimal.h')
-rw-r--r-- | xfa/fgas/localization/cfx_decimal.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/xfa/fgas/localization/cfx_decimal.h b/xfa/fgas/localization/cfx_decimal.h new file mode 100644 index 0000000000..36b898dc7d --- /dev/null +++ b/xfa/fgas/localization/cfx_decimal.h @@ -0,0 +1,42 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef XFA_FGAS_LOCALIZATION_CFX_DECIMAL_H_ +#define XFA_FGAS_LOCALIZATION_CFX_DECIMAL_H_ + +#include "core/fxcrt/fx_string.h" + +class CFX_Decimal { + public: + CFX_Decimal(); + explicit CFX_Decimal(uint32_t val); + explicit CFX_Decimal(uint64_t val); + explicit CFX_Decimal(int32_t val); + CFX_Decimal(float val, uint8_t scale); + explicit CFX_Decimal(const CFX_WideStringC& str); + + operator CFX_WideString() const; + operator double() const; + + CFX_Decimal operator*(const CFX_Decimal& val) const; + CFX_Decimal operator/(const CFX_Decimal& val) const; + + void SetScale(uint8_t newScale); + uint8_t GetScale(); + void SetNegate(); + + private: + CFX_Decimal(uint32_t hi, uint32_t mid, uint32_t lo, bool neg, uint8_t scale); + bool IsNotZero() const { return m_uHi || m_uMid || m_uLo; } + void Swap(CFX_Decimal& val); + + uint32_t m_uHi; + uint32_t m_uLo; + uint32_t m_uMid; + uint32_t m_uFlags; +}; + +#endif // XFA_FGAS_LOCALIZATION_CFX_DECIMAL_H_ |