itemfield.h
来自「Password Safe Password Safe is a passwor」· C头文件 代码 · 共 55 行
H
55 行
// ItemField.h//-----------------------------------------------------------------------------#if !defined ItemField_h#define ItemField_h#include "MyString.h"//-----------------------------------------------------------------------------/* * CItemField contains the data for a given CitemData field in encrypted * form. * Set() encrypts, Get() decrypts */class BlowFish;class CItemField { public: CItemField(unsigned char type): m_Type(type), m_Length(0), m_Data(NULL) {} CItemField(const CItemField &that); // copy ctor ~CItemField() {if (m_Length > 0) delete[] m_Data;} CItemField &operator=(const CItemField &that); void Set(const CMyString &value, BlowFish *bf); void Set(const unsigned char* value, unsigned int length, BlowFish *bf); void Get(CMyString &value, BlowFish *bf) const; void Get(unsigned char *value, unsigned int &length, BlowFish *bf) const; unsigned char GetType() const {return m_Type;} private: //Actual encryption/decryption void EncryptData(const CMyString &plain, BlowFish *bf); void DecryptData(CMyString &plain, BlowFish *bf) const; //Number of 8 byte blocks needed for size int GetBlockSize(int size) const; unsigned char m_Type; // const except for assignment operator unsigned int m_Length; unsigned char *m_Data;};#endif//-----------------------------------------------------------------------------// Local variables:// mode: c++// End:
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?