xref: /aosp_15_r20/external/pdfium/core/fpdfdoc/cpdf_filespec.h (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1 // Copyright 2016 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 CORE_FPDFDOC_CPDF_FILESPEC_H_
8 #define CORE_FPDFDOC_CPDF_FILESPEC_H_
9 
10 #include "core/fxcrt/retain_ptr.h"
11 #include "core/fxcrt/string_pool_template.h"
12 #include "core/fxcrt/weak_ptr.h"
13 #include "core/fxcrt/widestring.h"
14 
15 class CPDF_Dictionary;
16 class CPDF_Object;
17 class CPDF_Stream;
18 
19 class CPDF_FileSpec {
20  public:
21   explicit CPDF_FileSpec(RetainPtr<const CPDF_Object> pObj);
22   ~CPDF_FileSpec();
23 
24   // Convert a platform dependent file name into pdf format.
25   static WideString EncodeFileName(const WideString& filepath);
26 
27   // Convert a pdf file name into platform dependent format.
28   static WideString DecodeFileName(const WideString& filepath);
29 
30   WideString GetFileName() const;
31   RetainPtr<const CPDF_Stream> GetFileStream() const;
32   RetainPtr<const CPDF_Dictionary> GetParamsDict() const;
33   RetainPtr<CPDF_Dictionary> GetMutableParamsDict();
34 
35  private:
36   RetainPtr<const CPDF_Object> const m_pObj;
37 };
38 
39 #endif  // CORE_FPDFDOC_CPDF_FILESPEC_H_
40