• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2018 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 XFA_FGAS_FONT_CFX_FONTSOURCEENUM_FILE_H_
8 #define XFA_FGAS_FONT_CFX_FONTSOURCEENUM_FILE_H_
9 
10 #include <vector>
11 
12 #include "build/build_config.h"
13 #include "core/fxcrt/fx_stream.h"
14 #include "core/fxcrt/fx_string.h"
15 #include "core/fxcrt/fx_system.h"
16 #include "core/fxcrt/retain_ptr.h"
17 
18 #if defined(OS_WIN)
19 #error "Not used on Windows"
20 #endif
21 
22 class CFX_FontSourceEnum_File {
23  public:
24   CFX_FontSourceEnum_File();
25   ~CFX_FontSourceEnum_File();
26 
27   void GetNext();
28   bool HasNext() const;
29   RetainPtr<IFX_SeekableStream> GetStream() const;
30 
31  private:
32   struct HandleParentPath {
33     HandleParentPath() = default;
HandleParentPathHandleParentPath34     HandleParentPath(const HandleParentPath& x) {
35       pFolderHandle = x.pFolderHandle;
36       bsParentPath = x.bsParentPath;
37     }
38     FX_FolderHandle* pFolderHandle;
39     ByteString bsParentPath;
40   };
41 
42   ByteString GetNextFile();
43 
44   WideString m_wsNext;
45   std::vector<HandleParentPath> m_FolderQueue;
46   std::vector<ByteString> m_FolderPaths;
47 };
48 
49 #endif  // XFA_FGAS_FONT_CFX_FONTSOURCEENUM_FILE_H_
50