source: box/trunk/lib/backupstore/BackupStoreFilenameClear.h @ 3109

Revision 3109, 2.0 KB checked in by chris, 3 weeks ago (diff)

Revert r3106 as it causes compile failures not seen locally.

  • Property svn:eol-style set to native
Line 
1// --------------------------------------------------------------------------
2//
3// File
4//              Name:    BackupStoreFilenameClear.h
5//              Purpose: BackupStoreFilenames in the clear
6//              Created: 2003/08/26
7//
8// --------------------------------------------------------------------------
9
10#ifndef BACKUPSTOREFILENAMECLEAR__H
11#define BACKUPSTOREFILENAMECLEAR__H
12
13#include "BackupStoreFilename.h"
14
15class CipherContext;
16
17// --------------------------------------------------------------------------
18//
19// Class
20//              Name:    BackupStoreFilenameClear
21//              Purpose: BackupStoreFilenames, handling conversion from and to the in the clear version
22//              Created: 2003/08/26
23//
24// --------------------------------------------------------------------------
25class BackupStoreFilenameClear : public BackupStoreFilename
26{
27public:
28        BackupStoreFilenameClear();
29        BackupStoreFilenameClear(const std::string &rToEncode);
30        BackupStoreFilenameClear(const BackupStoreFilenameClear &rToCopy);
31        BackupStoreFilenameClear(const BackupStoreFilename &rToCopy);
32        virtual ~BackupStoreFilenameClear();
33
34        // Because we need to use a different allocator for this class to avoid
35        // nasty things happening, can't return this as a reference. Which is a
36        // pity. But probably not too bad.
37#ifdef BACKUPSTOREFILEAME_MALLOC_ALLOC_BASE_TYPE
38        const std::string GetClearFilename() const;
39#else
40        const std::string &GetClearFilename() const;
41        const std::string &GetClearFilenameIfPossible(const std::string& alternative) const;
42#endif
43        void SetClearFilename(const std::string &rToEncode);
44
45        // Setup for encryption of filenames   
46        static void SetBlowfishKey(const void *pKey, int KeyLength, const void *pIV, int IVLength);
47        static void SetEncodingMethod(int Method);
48       
49protected:
50        void MakeClearAvailable() const;
51        virtual void EncodedFilenameChanged();
52        void EncryptClear(const std::string &rToEncode, CipherContext &rCipherContext, int StoreAsEncoding);
53        void DecryptEncoded(CipherContext &rCipherContext) const;
54
55private:
56        mutable BackupStoreFilename_base mClearFilename;
57};
58
59#endif // BACKUPSTOREFILENAMECLEAR__H
60
61
Note: See TracBrowser for help on using the repository browser.