From a32145f1f16b7b02110bf359208f587d7d486551 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 6 Mar 2018 18:53:05 +0000 Subject: Rename core/fxcrt IFX files to Iface This CL renames the 3 IFX files in core/fxcrt to Iface instead. Change-Id: I7cee6836650b71bc5c5729a8147fda62f0910fe3 Reviewed-on: https://pdfium-review.googlesource.com/27970 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- core/fxcrt/cfx_fileaccess_posix.cpp | 2 +- core/fxcrt/cfx_fileaccess_posix.h | 6 +-- core/fxcrt/cfx_fileaccess_windows.cpp | 2 +- core/fxcrt/cfx_fileaccess_windows.h | 6 +-- core/fxcrt/fileaccess_iface.h | 38 ++++++++++++++++++ core/fxcrt/fx_stream.cpp | 10 ++--- core/fxcrt/ifx_fileaccess.h | 38 ------------------ core/fxcrt/ifx_locale.h | 76 ----------------------------------- core/fxcrt/ifx_pauseindicator.h | 16 -------- core/fxcrt/locale_iface.h | 76 +++++++++++++++++++++++++++++++++++ core/fxcrt/pauseindicator_iface.h | 16 ++++++++ 11 files changed, 143 insertions(+), 143 deletions(-) create mode 100644 core/fxcrt/fileaccess_iface.h delete mode 100644 core/fxcrt/ifx_fileaccess.h delete mode 100644 core/fxcrt/ifx_locale.h delete mode 100644 core/fxcrt/ifx_pauseindicator.h create mode 100644 core/fxcrt/locale_iface.h create mode 100644 core/fxcrt/pauseindicator_iface.h (limited to 'core/fxcrt') diff --git a/core/fxcrt/cfx_fileaccess_posix.cpp b/core/fxcrt/cfx_fileaccess_posix.cpp index 2f85670c59..4aab6fef46 100644 --- a/core/fxcrt/cfx_fileaccess_posix.cpp +++ b/core/fxcrt/cfx_fileaccess_posix.cpp @@ -41,7 +41,7 @@ void GetFileMode(uint32_t dwModes, int32_t& nFlags, int32_t& nMasks) { } // namespace // static -std::unique_ptr IFX_FileAccess::Create() { +std::unique_ptr FileAccessIface::Create() { return pdfium::MakeUnique(); } diff --git a/core/fxcrt/cfx_fileaccess_posix.h b/core/fxcrt/cfx_fileaccess_posix.h index efa25ebb4c..84fc81bd98 100644 --- a/core/fxcrt/cfx_fileaccess_posix.h +++ b/core/fxcrt/cfx_fileaccess_posix.h @@ -7,17 +7,17 @@ #ifndef CORE_FXCRT_CFX_FILEACCESS_POSIX_H_ #define CORE_FXCRT_CFX_FILEACCESS_POSIX_H_ -#include "core/fxcrt/ifx_fileaccess.h" +#include "core/fxcrt/fileaccess_iface.h" #if _FX_PLATFORM_ == _FX_PLATFORM_LINUX_ || \ _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ || \ _FX_PLATFORM_ == _FX_PLATFORM_ANDROID_ -class CFX_FileAccess_Posix : public IFX_FileAccess { +class CFX_FileAccess_Posix : public FileAccessIface { public: CFX_FileAccess_Posix(); ~CFX_FileAccess_Posix() override; - // IFX_FileAccess: + // FileAccessIface: bool Open(const ByteStringView& fileName, uint32_t dwMode) override; bool Open(const WideStringView& fileName, uint32_t dwMode) override; void Close() override; diff --git a/core/fxcrt/cfx_fileaccess_windows.cpp b/core/fxcrt/cfx_fileaccess_windows.cpp index 1ac4496edb..f416bb6b77 100644 --- a/core/fxcrt/cfx_fileaccess_windows.cpp +++ b/core/fxcrt/cfx_fileaccess_windows.cpp @@ -32,7 +32,7 @@ void GetFileMode(uint32_t dwMode, } // namespace // static -std::unique_ptr IFX_FileAccess::Create() { +std::unique_ptr FileAccessIface::Create() { return pdfium::MakeUnique(); } diff --git a/core/fxcrt/cfx_fileaccess_windows.h b/core/fxcrt/cfx_fileaccess_windows.h index 6fd07d553c..451462bbca 100644 --- a/core/fxcrt/cfx_fileaccess_windows.h +++ b/core/fxcrt/cfx_fileaccess_windows.h @@ -7,15 +7,15 @@ #ifndef CORE_FXCRT_CFX_FILEACCESS_WINDOWS_H_ #define CORE_FXCRT_CFX_FILEACCESS_WINDOWS_H_ -#include "core/fxcrt/ifx_fileaccess.h" +#include "core/fxcrt/fileaccess_iface.h" #if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ -class CFX_FileAccess_Windows : public IFX_FileAccess { +class CFX_FileAccess_Windows : public FileAccessIface { public: CFX_FileAccess_Windows(); ~CFX_FileAccess_Windows() override; - // IFX_FileAccess + // FileAccessIface bool Open(const ByteStringView& fileName, uint32_t dwMode) override; bool Open(const WideStringView& fileName, uint32_t dwMode) override; void Close() override; diff --git a/core/fxcrt/fileaccess_iface.h b/core/fxcrt/fileaccess_iface.h new file mode 100644 index 0000000000..c438f9ec47 --- /dev/null +++ b/core/fxcrt/fileaccess_iface.h @@ -0,0 +1,38 @@ +// Copyright 2014 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 CORE_FXCRT_FILEACCESS_IFACE_H_ +#define CORE_FXCRT_FILEACCESS_IFACE_H_ + +#include +#include + +#include "core/fxcrt/fx_safe_types.h" +#include "core/fxcrt/fx_stream.h" +#include "core/fxcrt/fx_string.h" + +class FileAccessIface { + public: + static std::unique_ptr Create(); + virtual ~FileAccessIface() {} + + virtual bool Open(const ByteStringView& fileName, uint32_t dwMode) = 0; + virtual bool Open(const WideStringView& fileName, uint32_t dwMode) = 0; + virtual void Close() = 0; + virtual FX_FILESIZE GetSize() const = 0; + virtual FX_FILESIZE GetPosition() const = 0; + virtual FX_FILESIZE SetPosition(FX_FILESIZE pos) = 0; + virtual size_t Read(void* pBuffer, size_t szBuffer) = 0; + virtual size_t Write(const void* pBuffer, size_t szBuffer) = 0; + virtual size_t ReadPos(void* pBuffer, size_t szBuffer, FX_FILESIZE pos) = 0; + virtual size_t WritePos(const void* pBuffer, + size_t szBuffer, + FX_FILESIZE pos) = 0; + virtual bool Flush() = 0; + virtual bool Truncate(FX_FILESIZE szFile) = 0; +}; + +#endif // CORE_FXCRT_FILEACCESS_IFACE_H_ diff --git a/core/fxcrt/fx_stream.cpp b/core/fxcrt/fx_stream.cpp index bd75ad6ec7..337cbb325c 100644 --- a/core/fxcrt/fx_stream.cpp +++ b/core/fxcrt/fx_stream.cpp @@ -11,8 +11,8 @@ #include #include +#include "core/fxcrt/fileaccess_iface.h" #include "core/fxcrt/fx_safe_types.h" -#include "core/fxcrt/ifx_fileaccess.h" #include "third_party/base/ptr_util.h" namespace { @@ -40,11 +40,11 @@ class CFX_CRTFileStream final : public IFX_SeekableStream { bool Flush() override { return m_pFile->Flush(); } private: - explicit CFX_CRTFileStream(std::unique_ptr pFA) + explicit CFX_CRTFileStream(std::unique_ptr pFA) : m_pFile(std::move(pFA)) {} ~CFX_CRTFileStream() override {} - std::unique_ptr m_pFile; + std::unique_ptr m_pFile; }; } // namespace @@ -53,7 +53,7 @@ class CFX_CRTFileStream final : public IFX_SeekableStream { RetainPtr IFX_SeekableStream::CreateFromFilename( const char* filename, uint32_t dwModes) { - std::unique_ptr pFA = IFX_FileAccess::Create(); + std::unique_ptr pFA = FileAccessIface::Create(); if (!pFA->Open(filename, dwModes)) return nullptr; return pdfium::MakeRetain(std::move(pFA)); @@ -63,7 +63,7 @@ RetainPtr IFX_SeekableStream::CreateFromFilename( RetainPtr IFX_SeekableStream::CreateFromFilename( const wchar_t* filename, uint32_t dwModes) { - std::unique_ptr pFA = IFX_FileAccess::Create(); + std::unique_ptr pFA = FileAccessIface::Create(); if (!pFA->Open(filename, dwModes)) return nullptr; return pdfium::MakeRetain(std::move(pFA)); diff --git a/core/fxcrt/ifx_fileaccess.h b/core/fxcrt/ifx_fileaccess.h deleted file mode 100644 index 9bfe2b4e63..0000000000 --- a/core/fxcrt/ifx_fileaccess.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2014 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 CORE_FXCRT_IFX_FILEACCESS_H_ -#define CORE_FXCRT_IFX_FILEACCESS_H_ - -#include -#include - -#include "core/fxcrt/fx_safe_types.h" -#include "core/fxcrt/fx_stream.h" -#include "core/fxcrt/fx_string.h" - -class IFX_FileAccess { - public: - static std::unique_ptr Create(); - virtual ~IFX_FileAccess() {} - - virtual bool Open(const ByteStringView& fileName, uint32_t dwMode) = 0; - virtual bool Open(const WideStringView& fileName, uint32_t dwMode) = 0; - virtual void Close() = 0; - virtual FX_FILESIZE GetSize() const = 0; - virtual FX_FILESIZE GetPosition() const = 0; - virtual FX_FILESIZE SetPosition(FX_FILESIZE pos) = 0; - virtual size_t Read(void* pBuffer, size_t szBuffer) = 0; - virtual size_t Write(const void* pBuffer, size_t szBuffer) = 0; - virtual size_t ReadPos(void* pBuffer, size_t szBuffer, FX_FILESIZE pos) = 0; - virtual size_t WritePos(const void* pBuffer, - size_t szBuffer, - FX_FILESIZE pos) = 0; - virtual bool Flush() = 0; - virtual bool Truncate(FX_FILESIZE szFile) = 0; -}; - -#endif // CORE_FXCRT_IFX_FILEACCESS_H_ diff --git a/core/fxcrt/ifx_locale.h b/core/fxcrt/ifx_locale.h deleted file mode 100644 index 5918e7a183..0000000000 --- a/core/fxcrt/ifx_locale.h +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2014 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 CORE_FXCRT_IFX_LOCALE_H_ -#define CORE_FXCRT_IFX_LOCALE_H_ - -#include "core/fxcrt/cfx_datetime.h" -#include "core/fxcrt/fx_string.h" - -enum FX_LOCALENUMSYMBOL { - FX_LOCALENUMSYMBOL_Decimal, - FX_LOCALENUMSYMBOL_Grouping, - FX_LOCALENUMSYMBOL_Percent, - FX_LOCALENUMSYMBOL_Minus, - FX_LOCALENUMSYMBOL_Zero, - FX_LOCALENUMSYMBOL_CurrencySymbol, - FX_LOCALENUMSYMBOL_CurrencyName, -}; - -enum FX_LOCALEDATETIMESUBCATEGORY { - FX_LOCALEDATETIMESUBCATEGORY_Default, - FX_LOCALEDATETIMESUBCATEGORY_Short, - FX_LOCALEDATETIMESUBCATEGORY_Medium, - FX_LOCALEDATETIMESUBCATEGORY_Full, - FX_LOCALEDATETIMESUBCATEGORY_Long, -}; - -enum FX_LOCALENUMSUBCATEGORY { - FX_LOCALENUMPATTERN_Percent, - FX_LOCALENUMPATTERN_Currency, - FX_LOCALENUMPATTERN_Decimal, - FX_LOCALENUMPATTERN_Integer, -}; - -enum FX_LOCALECATEGORY { - FX_LOCALECATEGORY_Unknown, - FX_LOCALECATEGORY_Date, - FX_LOCALECATEGORY_Time, - FX_LOCALECATEGORY_DateTime, - FX_LOCALECATEGORY_Num, - FX_LOCALECATEGORY_Text, - FX_LOCALECATEGORY_Zero, - FX_LOCALECATEGORY_Null, -}; - -enum FX_DATETIMETYPE { - FX_DATETIMETYPE_Unknown, - FX_DATETIMETYPE_Date, - FX_DATETIMETYPE_Time, - FX_DATETIMETYPE_DateTime, - FX_DATETIMETYPE_TimeDate, -}; - -class IFX_Locale { - public: - virtual ~IFX_Locale() {} - - virtual WideString GetName() const = 0; - virtual WideString GetNumbericSymbol(FX_LOCALENUMSYMBOL eType) const = 0; - virtual WideString GetDateTimeSymbols() const = 0; - virtual WideString GetMonthName(int32_t nMonth, bool bAbbr) const = 0; - virtual WideString GetDayName(int32_t nWeek, bool bAbbr) const = 0; - virtual WideString GetMeridiemName(bool bAM) const = 0; - virtual FX_TIMEZONE GetTimeZone() const = 0; - virtual WideString GetEraName(bool bAD) const = 0; - virtual WideString GetDatePattern( - FX_LOCALEDATETIMESUBCATEGORY eType) const = 0; - virtual WideString GetTimePattern( - FX_LOCALEDATETIMESUBCATEGORY eType) const = 0; - virtual WideString GetNumPattern(FX_LOCALENUMSUBCATEGORY eType) const = 0; -}; - -#endif // CORE_FXCRT_IFX_LOCALE_H_ diff --git a/core/fxcrt/ifx_pauseindicator.h b/core/fxcrt/ifx_pauseindicator.h deleted file mode 100644 index 79c6016706..0000000000 --- a/core/fxcrt/ifx_pauseindicator.h +++ /dev/null @@ -1,16 +0,0 @@ -// 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 CORE_FXCRT_IFX_PAUSEINDICATOR_H_ -#define CORE_FXCRT_IFX_PAUSEINDICATOR_H_ - -class IFX_PauseIndicator { - public: - virtual ~IFX_PauseIndicator() {} - virtual bool NeedToPauseNow() = 0; -}; - -#endif // CORE_FXCRT_IFX_PAUSEINDICATOR_H_ diff --git a/core/fxcrt/locale_iface.h b/core/fxcrt/locale_iface.h new file mode 100644 index 0000000000..0adfb19682 --- /dev/null +++ b/core/fxcrt/locale_iface.h @@ -0,0 +1,76 @@ +// Copyright 2014 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 CORE_FXCRT_LOCALE_IFACE_H_ +#define CORE_FXCRT_LOCALE_IFACE_H_ + +#include "core/fxcrt/cfx_datetime.h" +#include "core/fxcrt/fx_string.h" + +enum FX_LOCALENUMSYMBOL { + FX_LOCALENUMSYMBOL_Decimal, + FX_LOCALENUMSYMBOL_Grouping, + FX_LOCALENUMSYMBOL_Percent, + FX_LOCALENUMSYMBOL_Minus, + FX_LOCALENUMSYMBOL_Zero, + FX_LOCALENUMSYMBOL_CurrencySymbol, + FX_LOCALENUMSYMBOL_CurrencyName, +}; + +enum FX_LOCALEDATETIMESUBCATEGORY { + FX_LOCALEDATETIMESUBCATEGORY_Default, + FX_LOCALEDATETIMESUBCATEGORY_Short, + FX_LOCALEDATETIMESUBCATEGORY_Medium, + FX_LOCALEDATETIMESUBCATEGORY_Full, + FX_LOCALEDATETIMESUBCATEGORY_Long, +}; + +enum FX_LOCALENUMSUBCATEGORY { + FX_LOCALENUMPATTERN_Percent, + FX_LOCALENUMPATTERN_Currency, + FX_LOCALENUMPATTERN_Decimal, + FX_LOCALENUMPATTERN_Integer, +}; + +enum FX_LOCALECATEGORY { + FX_LOCALECATEGORY_Unknown, + FX_LOCALECATEGORY_Date, + FX_LOCALECATEGORY_Time, + FX_LOCALECATEGORY_DateTime, + FX_LOCALECATEGORY_Num, + FX_LOCALECATEGORY_Text, + FX_LOCALECATEGORY_Zero, + FX_LOCALECATEGORY_Null, +}; + +enum FX_DATETIMETYPE { + FX_DATETIMETYPE_Unknown, + FX_DATETIMETYPE_Date, + FX_DATETIMETYPE_Time, + FX_DATETIMETYPE_DateTime, + FX_DATETIMETYPE_TimeDate, +}; + +class LocaleIface { + public: + virtual ~LocaleIface() {} + + virtual WideString GetName() const = 0; + virtual WideString GetNumbericSymbol(FX_LOCALENUMSYMBOL eType) const = 0; + virtual WideString GetDateTimeSymbols() const = 0; + virtual WideString GetMonthName(int32_t nMonth, bool bAbbr) const = 0; + virtual WideString GetDayName(int32_t nWeek, bool bAbbr) const = 0; + virtual WideString GetMeridiemName(bool bAM) const = 0; + virtual FX_TIMEZONE GetTimeZone() const = 0; + virtual WideString GetEraName(bool bAD) const = 0; + virtual WideString GetDatePattern( + FX_LOCALEDATETIMESUBCATEGORY eType) const = 0; + virtual WideString GetTimePattern( + FX_LOCALEDATETIMESUBCATEGORY eType) const = 0; + virtual WideString GetNumPattern(FX_LOCALENUMSUBCATEGORY eType) const = 0; +}; + +#endif // CORE_FXCRT_LOCALE_IFACE_H_ diff --git a/core/fxcrt/pauseindicator_iface.h b/core/fxcrt/pauseindicator_iface.h new file mode 100644 index 0000000000..c12b02e427 --- /dev/null +++ b/core/fxcrt/pauseindicator_iface.h @@ -0,0 +1,16 @@ +// 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 CORE_FXCRT_PAUSEINDICATOR_IFACE_H_ +#define CORE_FXCRT_PAUSEINDICATOR_IFACE_H_ + +class PauseIndicatorIface { + public: + virtual ~PauseIndicatorIface() {} + virtual bool NeedToPauseNow() = 0; +}; + +#endif // CORE_FXCRT_PAUSEINDICATOR_IFACE_H_ -- cgit v1.2.3