• R/O
  • SSH
  • HTTPS

cscdencr: コミット


コミットメタ情報

リビジョン17 (tree)
日時2009-11-21 23:28:54
作者yk700101

ログメッセージ

clean up source codes

変更サマリ

差分

--- trunk/src/CscdEncr/FunctionsKeyFileException.h (revision 16)
+++ trunk/src/CscdEncr/FunctionsKeyFileException.h (revision 17)
@@ -20,7 +20,7 @@
2020 class FunctionsKeyFileException : public std::exception
2121 {
2222 public:
23- explicit FunctionsKeyFileException(const std::string & i_What)
23+ explicit FunctionsKeyFileException(const std::string& i_What)
2424 : std::exception(i_What.c_str())
2525 {
2626 }
@@ -30,8 +30,8 @@
3030 }
3131
3232 //(use default)
33- //FunctionsKeyFileException(const FunctionsKeyFileException &);
33+ //FunctionsKeyFileException(const FunctionsKeyFileException&);
3434
3535 //(use default)
36- //FunctionsKeyFileException & operator =( const FunctionsKeyFileException & );
36+ //FunctionsKeyFileException& operator =( const FunctionsKeyFileException&);
3737 };
--- trunk/src/CscdEncr/Functions.cpp (revision 16)
+++ trunk/src/CscdEncr/Functions.cpp (revision 17)
@@ -28,7 +28,7 @@
2828
2929 void GetEntropyFromKeyboard(
3030 int i_EntoropyToGather,
31- CryptoPP::SecByteBlock & o_EntropyOfUserInput
31+ CryptoPP::SecByteBlock& o_EntropyOfUserInput
3232 );
3333
3434 }
@@ -40,7 +40,7 @@
4040 // Get string(UTF8) from wstring(UTF16)
4141 //
4242 std::string Get_string_UTF8_From_wstring_UTF16(
43- const std::wstring & i_wstring_UTF16
43+ const std::wstring& i_wstring_UTF16
4444 )
4545 {
4646 std::string string_UTF8;
@@ -58,7 +58,7 @@
5858 // Get wstring(UTF16) from string(UTF8)
5959 //
6060 std::wstring Get_wstring_UTF16_From_string_UTF8(
61- const std::string & i_string_UTF8
61+ const std::string& i_string_UTF8
6262 )
6363 {
6464 std::wstring wstring_UTF16;
@@ -141,8 +141,8 @@
141141 //
142142 void CreateKeyAndIV(
143143 OptionOfCommandLine::AdditionalEntropy i_AdditionalEntropy,
144- CryptoPP::SecByteBlock & o_Key,
145- CryptoPP::SecByteBlock & o_IV
144+ CryptoPP::SecByteBlock& o_Key,
145+ CryptoPP::SecByteBlock& o_IV
146146 )
147147 {
148148 const int ENTOROPY_TO_GATHER =
@@ -190,8 +190,8 @@
190190 // Get SecByteBlock from Hexadecimal string
191191 //
192192 void GetSecByteBlockFromHexString(
193- const std::string & i_HexString,
194- CryptoPP::SecByteBlock & o_SecByteBlock
193+ const std::string& i_HexString,
194+ CryptoPP::SecByteBlock& o_SecByteBlock
195195 )
196196 {
197197 std::string hex_string_left_padded(
@@ -214,8 +214,8 @@
214214 // Get Hexadecimal string from SecByteBlock
215215 //
216216 void GetHexStringFromSecByteBlock(
217- const CryptoPP::SecByteBlock & i_SecByteBlock,
218- std::string & o_HexString
217+ const CryptoPP::SecByteBlock& i_SecByteBlock,
218+ std::string& o_HexString
219219 )
220220 {
221221 CryptoPP::StringSource(
@@ -236,8 +236,8 @@
236236 // Get modified SecByteBlock key
237237 //
238238 CryptoPP::SecByteBlock GetModifiedKey(
239- const std::string & i_HexStringOfAdditionKey,
240- const CryptoPP::SecByteBlock & i_Key
239+ const std::string& i_HexStringOfAdditionKey,
240+ const CryptoPP::SecByteBlock& i_Key
241241 )
242242 {
243243 CryptoPP::SecByteBlock key_modified(i_Key.size());
@@ -337,7 +337,7 @@
337337 //
338338 void GetEntropyFromKeyboard(
339339 int i_EntoropyToGather,
340- CryptoPP::SecByteBlock & o_EntropyOfUserInput
340+ CryptoPP::SecByteBlock& o_EntropyOfUserInput
341341 )
342342 {
343343 const int ENTOROPY_OF_EACH_KEY_PRESS = 2;
--- trunk/src/CscdEncr/FunctionsKeyData.cpp (revision 16)
+++ trunk/src/CscdEncr/FunctionsKeyData.cpp (revision 17)
@@ -27,24 +27,24 @@
2727 {
2828 namespace Delimiter
2929 {
30- const char *const EQUAL = "=";
31- const char *const COMMA = ",";
30+ const char*const EQUAL = "=";
31+ const char*const COMMA = ",";
3232 }
3333
3434 namespace ErrorMessage
3535 {
36- const char *const SPACE = " ";
36+ const char*const SPACE = " ";
3737 }
3838
3939 std::string MakeErrorMessage_WrongEncryptionName(
40- const std::string & i_VarName_ENCRYPTION_NAME,
41- const std::string & i_EncryptionName
40+ const std::string& i_VarName_ENCRYPTION_NAME,
41+ const std::string& i_EncryptionName
4242 );
4343
4444 std::string MakeErrorMessage_MismatchOfEncryptionTimes(
45- const std::string & i_VarName_ENCRYPTION_NAME,
45+ const std::string& i_VarName_ENCRYPTION_NAME,
4646 int i_EncryptionTimes_ENCRYPTION_NAME,
47- const std::string & i_VarName,
47+ const std::string& i_VarName,
4848 int i_EncryptionTimes
4949 );
5050 }
@@ -56,11 +56,11 @@
5656 // Set encryption related data
5757 //
5858 void SetEncryptionRelatedData(
59- const std::string & i_VarName,
60- const std::string & i_VarValueCSV,
61- const std::string & i_VarName_EncryptionName,
59+ const std::string& i_VarName,
60+ const std::string& i_VarValueCSV,
61+ const std::string& i_VarName_EncryptionName,
6262 int i_Count_EncryptionName,
63- std::vector<std::string> & o_AllData
63+ std::vector<std::string>& o_AllData
6464 )
6565 {
6666 boost::split(
@@ -73,7 +73,7 @@
7373 {
7474 PresetEncryptionInfo preset_encryption_info;
7575
76- BOOST_FOREACH(const std::string & encryption_name, o_AllData)
76+ BOOST_FOREACH(const std::string& encryption_name, o_AllData)
7777 {
7878 try
7979 {
@@ -112,13 +112,13 @@
112112 {
113113
114114 std::string MakeErrorMessage_WrongEncryptionName(
115- const std::string & i_VarName_ENCRYPTION_NAME,
116- const std::string & i_EncryptionName
115+ const std::string& i_VarName_ENCRYPTION_NAME,
116+ const std::string& i_EncryptionName
117117 )
118118 {
119- std::stringstream ss;
119+ std::ostringstream os;
120120
121- ss
121+ os
122122 << "'"
123123 << i_EncryptionName
124124 << "'"
@@ -130,20 +130,20 @@
130130 << "is wrong."
131131 ;
132132
133- return ss.str();
133+ return os.str();
134134 }
135135
136136
137137 std::string MakeErrorMessage_MismatchOfEncryptionTimes(
138- const std::string & i_VarName_ENCRYPTION_NAME,
138+ const std::string& i_VarName_ENCRYPTION_NAME,
139139 int i_EncryptionTimes_ENCRYPTION_NAME,
140- const std::string & i_VarName,
140+ const std::string& i_VarName,
141141 int i_EncryptionTimes
142142 )
143143 {
144- std::stringstream ss;
144+ std::ostringstream os;
145145
146- ss
146+ os
147147 << "Mismatch of encryption times."
148148 << ErrorMessage::SPACE
149149
@@ -168,7 +168,7 @@
168168 << i_EncryptionTimes
169169 ;
170170
171- return ss.str();
171+ return os.str();
172172 }
173173
174174 }
--- trunk/src/CscdEncr/EncryptionInfo.h (revision 16)
+++ trunk/src/CscdEncr/EncryptionInfo.h (revision 17)
@@ -18,14 +18,14 @@
1818 #include "PresetEncryptionInfo.h"
1919 #include "OptionOfCommandLine.h"
2020
21-class EncryptionInfo : boost::noncopyable
21+class EncryptionInfo : private boost::noncopyable
2222 {
2323 public:
2424 EncryptionInfo(
25- const std::vector<std::string> & i_AllSpecifiedEncryptionName,
26- const std::vector<std::string> & i_AllEncryptionKeyHex,
27- const std::vector<std::string> & i_AllEncryptionIVHex,
28- const std::map<std::string, std::string> & i_map_EncryptionName_KeyHex,
25+ const std::vector<std::string>& i_AllSpecifiedEncryptionName,
26+ const std::vector<std::string>& i_AllEncryptionKeyHex,
27+ const std::vector<std::string>& i_AllEncryptionIVHex,
28+ const std::map<std::string, std::string>& i_map_EncryptionName_KeyHex,
2929 OptionOfCommandLine::AdditionalEntropy i_AdditionalEntropy,
3030 int i_EncryptionTimes
3131 );
@@ -33,22 +33,22 @@
3333 ~EncryptionInfo();
3434
3535 public:
36- const std::vector<std::string> & GetAllEncryptionName() const
36+ const std::vector<std::string>& GetAllEncryptionName() const
3737 {
3838 return m_AllEncryptionName;
3939 }
4040
41- const std::vector<CryptoPP::SecByteBlock> & GetAllEncryptionKey() const
41+ const std::vector<CryptoPP::SecByteBlock>& GetAllEncryptionKey() const
4242 {
4343 return m_AllEncryptionKey;
4444 }
4545
46- const std::vector<CryptoPP::SecByteBlock> & GetAllEncryptionIV() const
46+ const std::vector<CryptoPP::SecByteBlock>& GetAllEncryptionIV() const
4747 {
4848 return m_AllEncryptionIV;
4949 }
5050
51- const std::vector<TSharedPointer_StreamTransformation> & GetAllEncryptionHolder() const
51+ const std::vector<TSharedPointer_StreamTransformation>& GetAllEncryptionHolder() const
5252 {
5353 return m_AllEncryptionHolder;
5454 }
@@ -60,9 +60,9 @@
6060 std::vector<TSharedPointer_StreamTransformation> m_AllEncryptionHolder;
6161
6262 private:
63- const std::string & GetKeyHexFrom_map_EncryptionName_KeyHex(
64- const std::map<std::string, std::string> & i_map_EncryptionName_KeyHex,
65- const std::string & i_EncryptionName
63+ const std::string& GetKeyHexFrom_map_EncryptionName_KeyHex(
64+ const std::map<std::string, std::string>& i_map_EncryptionName_KeyHex,
65+ const std::string& i_EncryptionName
6666 ) const;
6767
6868 };
--- trunk/src/CscdEncr/KeyFileException.h (revision 16)
+++ trunk/src/CscdEncr/KeyFileException.h (revision 17)
@@ -20,7 +20,7 @@
2020 class KeyFileException : public std::exception
2121 {
2222 public:
23- explicit KeyFileException(const std::string & i_What)
23+ explicit KeyFileException(const std::string& i_What)
2424 : std::exception(i_What.c_str())
2525 {
2626 }
@@ -30,8 +30,8 @@
3030 }
3131
3232 //(use default)
33- //KeyFileException(const KeyFileException &);
33+ //KeyFileException(const KeyFileException&);
3434
3535 //(use default)
36- //KeyFileException & operator =( const KeyFileException & );
36+ //KeyFileException& operator =( const KeyFileException&);
3737 };
--- trunk/src/CscdEncr/PresetEncryptionInfoException.h (revision 16)
+++ trunk/src/CscdEncr/PresetEncryptionInfoException.h (revision 17)
@@ -29,8 +29,8 @@
2929 }
3030
3131 //(use default)
32- //PresetEncryptionInfoException(const PresetEncryptionInfoException &);
32+ //PresetEncryptionInfoException(const PresetEncryptionInfoException&);
3333
3434 //(use default)
35- //PresetEncryptionInfoException & operator =( const PresetEncryptionInfoException & );
35+ //PresetEncryptionInfoException& operator =( const PresetEncryptionInfoException&);
3636 };
--- trunk/src/CscdEncr/PresetEncryptionInfoItem.h (revision 16)
+++ trunk/src/CscdEncr/PresetEncryptionInfoItem.h (revision 17)
@@ -19,9 +19,9 @@
1919 {
2020 public:
2121 PresetEncryptionInfoItem(
22- const std::string & i_AlgorithmName,
22+ const std::string& i_AlgorithmName,
2323 int i_KeyLength,
24- const std::string & i_ModeName,
24+ const std::string& i_ModeName,
2525 int i_IVLength
2626 );
2727
@@ -28,13 +28,13 @@
2828 ~PresetEncryptionInfoItem();
2929
3030 //(use default)
31- //PresetEncryptionInfoItem(const PresetEncryptionInfoItem &);
31+ //PresetEncryptionInfoItem(const PresetEncryptionInfoItem&);
3232
3333 //(use default)
34- //PresetEncryptionInfoItem & operator =( const PresetEncryptionInfoItem & );
34+ //PresetEncryptionInfoItem& operator =( const PresetEncryptionInfoItem&);
3535
3636 public:
37- const std::string & GetAlgorithmName() const
37+ const std::string& GetAlgorithmName() const
3838 {
3939 return m_AlgorithmName;
4040 }
@@ -44,7 +44,7 @@
4444 return m_KeyLength;
4545 }
4646
47- const std::string & GetModeName() const
47+ const std::string& GetModeName() const
4848 {
4949 return m_ModeName;
5050 }
--- trunk/src/CscdEncr/FunctionsKeyFile.cpp (revision 16)
+++ trunk/src/CscdEncr/FunctionsKeyFile.cpp (revision 17)
@@ -29,9 +29,9 @@
2929 // Output variable whitch have hexadecimal value(CSV)
3030 //
3131 void OutputVarHexValueCSV(
32- const std::string & i_VarName,
33- const std::vector<CryptoPP::SecByteBlock> & i_AllValue,
34- std::stringstream & io_OutputData
32+ const std::string& i_VarName,
33+ const std::vector<CryptoPP::SecByteBlock>& i_AllValue,
34+ std::stringstream& io_OutputData
3535 )
3636 {
3737 io_OutputData
@@ -68,8 +68,8 @@
6868 // Confirm existence of required variables
6969 //
7070 void ConfirmExistenceOfRequiredVariables(
71- const std::vector<std::string> & i_required_variables,
72- const boost::program_options::variables_map & i_key_file_var_map
71+ const std::vector<std::string>& i_required_variables,
72+ const boost::program_options::variables_map& i_key_file_var_map
7373 )
7474 {
7575 BOOST_FOREACH(std::string var_name, i_required_variables)
@@ -84,27 +84,27 @@
8484 }
8585
8686 std::string MakeErrorMessage_VariableCannotGet(
87- const std::string & i_VarName
87+ const std::string& i_VarName
8888 )
8989 {
90- std::stringstream ss;
90+ std::ostringstream os;
9191
92- ss
92+ os
9393 << i_VarName
9494 << ErrorMessage::SPACE
9595 << "cannot get."
9696 ;
9797
98- return ss.str();
98+ return os.str();
9999 }
100100
101101 std::string MakeErrorMessage_ThereIsNoVariable(
102- const std::string & i_VarName
102+ const std::string& i_VarName
103103 )
104104 {
105- std::stringstream ss;
105+ std::ostringstream os;
106106
107- ss
107+ os
108108 << "There is no"
109109 << ErrorMessage::SPACE
110110 << i_VarName
@@ -112,7 +112,7 @@
112112 << "variable."
113113 ;
114114
115- return ss.str();
115+ return os.str();
116116 }
117117
118118 }
--- trunk/src/CscdEncr/SecondKeyFile.cpp (revision 16)
+++ trunk/src/CscdEncr/SecondKeyFile.cpp (revision 17)
@@ -27,9 +27,9 @@
2727
2828 namespace VarName
2929 {
30- const char *const VERSION = "version";
31- const char *const ADDITION_ENCRYPTION_NAME = "addition-encryption-name";
32- const char *const ADDITION_ENCRYPTION_KEY_HEX = "addition-encryption-key-hex";
30+ const char*const VERSION = "version";
31+ const char*const ADDITION_ENCRYPTION_NAME = "addition-encryption-name";
32+ const char*const ADDITION_ENCRYPTION_KEY_HEX = "addition-encryption-key-hex";
3333 }
3434
3535 //--------------------------------------------------
@@ -36,7 +36,7 @@
3636 // Read data from key file
3737 //
3838 SecondKeyFile::SecondKeyFile(
39- const std::wstring & i_SecondKeyFileName
39+ const std::wstring& i_SecondKeyFileName
4040 )
4141 :
4242 m_Map_Addition_EncryptionName_KeyHex()
@@ -74,7 +74,7 @@
7474 key_file_var_map
7575 );
7676 }
77- catch(boost::program_options::error &e)
77+ catch(boost::program_options::error& e)
7878 {
7979 throw SecondKeyFileException(e.what());
8080 }
@@ -98,7 +98,7 @@
9898 key_file_var_map
9999 );
100100 }
101- catch(FunctionsKeyFileException &e)
101+ catch(FunctionsKeyFileException& e)
102102 {
103103 throw SecondKeyFileException(e.what());
104104 }
@@ -146,7 +146,7 @@
146146 );
147147 }
148148 }
149- catch(FunctionsKeyDataException &e)
149+ catch(FunctionsKeyDataException& e)
150150 {
151151 throw SecondKeyFileException(e.what());
152152 }
@@ -161,10 +161,10 @@
161161 // Make output data for second key file
162162 //
163163 void SecondKeyFile::MakeOutputData(
164- const std::string & i_Version,
165- const std::vector<std::string> & i_AllAdditionEncryptionName,
166- const std::vector<CryptoPP::SecByteBlock> & i_AllAdditionEncryptionKey,
167- std::stringstream & io_OutputData
164+ const std::string& i_Version,
165+ const std::vector<std::string>& i_AllAdditionEncryptionName,
166+ const std::vector<CryptoPP::SecByteBlock>& i_AllAdditionEncryptionKey,
167+ std::stringstream& io_OutputData
168168 )
169169 {
170170 //----------
@@ -226,18 +226,18 @@
226226
227227
228228 std::string SecondKeyFile::MakeErrorMessage_FileAlreadyExists(
229- const std::wstring & i_FileName
229+ const std::wstring& i_FileName
230230 )
231231 {
232- std::stringstream ss;
232+ std::ostringstream os;
233233
234- ss
234+ os
235235 << Functions::Get_string_UTF8_From_wstring_UTF16(i_FileName)
236236 << FunctionsKeyFile::ErrorMessage::SPACE
237237 << "already exists."
238238 ;
239239
240- return ss.str();
240+ return os.str();
241241 }
242242
243243
@@ -245,9 +245,9 @@
245245 // Make map<std::string, std::string> from two vector
246246 //
247247 void SecondKeyFile::MakeMapStringStringFromTwoVector(
248- const std::vector<std::string> & i_vectorStringKey,
249- const std::vector<std::string> & i_vectorStringValue,
250- std::map<std::string, std::string> & o_map_EncryptionName_KeyHex
248+ const std::vector<std::string>& i_vectorStringKey,
249+ const std::vector<std::string>& i_vectorStringValue,
250+ std::map<std::string, std::string>& o_map_EncryptionName_KeyHex
251251 )
252252 {
253253 const std::vector<std::string>::size_type
--- trunk/src/CscdEncr/CscdEncr.cpp (revision 16)
+++ trunk/src/CscdEncr/CscdEncr.cpp (revision 17)
@@ -71,53 +71,53 @@
7171 // Functions
7272 //----------------------------------------
7373 void main_SetStandardInputOutputToBinaryMode();
74-void main_GetRunOptions(int i_Argc, _TCHAR * i_Argv[]);
74+void main_GetRunOptions(int i_Argc, _TCHAR* i_Argv[]);
7575
7676 void main_Encrypt();
7777 void main_Encrypt_Get_ofstream_of_cipher_and_key(
78- std::ofstream & o_ofs_cipher_file,
79- std::ofstream & o_ofs_key_file
78+ std::ofstream& o_ofs_cipher_file,
79+ std::ofstream& o_ofs_key_file
8080 );
8181 void main_Encrypt_EncryptPlainData(
82- const std::vector<TSharedPointer_StreamTransformation> & i_AllEncryptionHolder,
83- std::ofstream & io_ofs_cipher_file,
84- std::string & o_StrAdler32
82+ const std::vector<TSharedPointer_StreamTransformation>& i_AllEncryptionHolder,
83+ std::ofstream& io_ofs_cipher_file,
84+ std::string& o_StrAdler32
8585 );
8686 void main_Encrypt_OutputKeyFile(
87- const std::vector<std::string> & i_AllEncryptionName,
88- const std::vector<CryptoPP::SecByteBlock> & i_AllEncryptionKey,
89- const std::vector<CryptoPP::SecByteBlock> & i_AllEncryptionIV,
90- const std::string & i_str_adler32_of_plain,
91- std::ofstream & io_ofs_key_file
87+ const std::vector<std::string>& i_AllEncryptionName,
88+ const std::vector<CryptoPP::SecByteBlock>& i_AllEncryptionKey,
89+ const std::vector<CryptoPP::SecByteBlock>& i_AllEncryptionIV,
90+ const std::string& i_str_adler32_of_plain,
91+ std::ofstream& io_ofs_key_file
9292 );
9393
9494 void main_Decrypt();
9595 void main_Decrypt_Get_ofstream_of_plain(
96- std::ofstream & o_ofs_plain_file
96+ std::ofstream& o_ofs_plain_file
9797 );
9898 void main_Decrypt_DecryptCipherData(
99- const std::vector<TSharedPointer_StreamTransformation> & i_AllEncryptionHolder,
100- std::ofstream & o_ofs_plain_file,
101- std::string & o_StrAdler32
99+ const std::vector<TSharedPointer_StreamTransformation>& i_AllEncryptionHolder,
100+ std::ofstream& o_ofs_plain_file,
101+ std::string& o_StrAdler32
102102 );
103103
104104 void main_MakeSecondKey();
105105 void main_MakeSecondKey_GetAllEncryptionNameAndKey(
106- std::vector<std::string> & o_AllEncryptionName,
107- std::vector<CryptoPP::SecByteBlock> & o_AllEncryptionKey
106+ std::vector<std::string>& o_AllEncryptionName,
107+ std::vector<CryptoPP::SecByteBlock>& o_AllEncryptionKey
108108 );
109109 void main_MakeSecondKey_Get_ofstream_of_second_key(
110- std::ofstream & o_ofs_key_file
110+ std::ofstream& o_ofs_key_file
111111 );
112112
113113 void ChangeFilenameByInsertIntoBetweenBasenameAndExtension(
114- const std::wstring & i_wstring_timestamp,
115- std::wstring & io_wstring_filename
114+ const std::wstring& i_wstring_timestamp,
115+ std::wstring& io_wstring_filename
116116 );
117117
118118 }
119119
120-int _tmain(int i_Argc, _TCHAR * i_Argv[])
120+int _tmain(int i_Argc, _TCHAR* i_Argv[])
121121 {
122122
123123 #ifdef _DEBUG
@@ -179,7 +179,7 @@
179179 }
180180
181181 }
182- catch(OptionOfCommandLineException &e)
182+ catch(OptionOfCommandLineException& e)
183183 {
184184 std::cerr
185185 << std::endl
@@ -191,7 +191,7 @@
191191
192192 return -1;
193193 }
194- catch(KeyFileException &e)
194+ catch(KeyFileException& e)
195195 {
196196 std::cerr
197197 << std::endl
@@ -203,7 +203,7 @@
203203
204204 return -1;
205205 }
206- catch(SecondKeyFileException &e)
206+ catch(SecondKeyFileException& e)
207207 {
208208 std::cerr
209209 << std::endl
@@ -226,7 +226,7 @@
226226
227227 return -1;
228228 }
229- catch(ExceptionUnexpected &e)
229+ catch(ExceptionUnexpected& e)
230230 {
231231 std::cerr
232232 << std::endl
@@ -238,7 +238,7 @@
238238
239239 return -1;
240240 }
241- catch(CryptoPP::Exception &e)
241+ catch(CryptoPP::Exception& e)
242242 {
243243 std::cerr
244244 << std::endl
@@ -250,7 +250,7 @@
250250
251251 return -1;
252252 }
253- catch(std::exception &e)
253+ catch(std::exception& e)
254254 {
255255 std::cerr
256256 << std::endl
@@ -304,7 +304,7 @@
304304 //--------------------------------------------------
305305 // Get run options (Subroutine of main)
306306 //
307-void main_GetRunOptions(int i_Argc, _TCHAR * i_Argv[])
307+void main_GetRunOptions(int i_Argc, _TCHAR* i_Argv[])
308308 {
309309 //----------------------------------------
310310 // Get command line options
@@ -400,8 +400,8 @@
400400 // Get ofstream of cipher file and key file (Subroutine of main_Encrypt)
401401 //
402402 void main_Encrypt_Get_ofstream_of_cipher_and_key(
403- std::ofstream & o_ofs_cipher_file,
404- std::ofstream & o_ofs_key_file
403+ std::ofstream& o_ofs_cipher_file,
404+ std::ofstream& o_ofs_key_file
405405 )
406406 {
407407 std::wstring cipher_file_name(m_CipherFileName);
@@ -475,9 +475,9 @@
475475 // Encrypt plain data (Subroutine of main_Encrypt)
476476 //
477477 void main_Encrypt_EncryptPlainData(
478- const std::vector<TSharedPointer_StreamTransformation> & i_AllEncryptionHolder,
479- std::ofstream & io_ofs_cipher_file,
480- std::string & o_StrAdler32
478+ const std::vector<TSharedPointer_StreamTransformation>& i_AllEncryptionHolder,
479+ std::ofstream& io_ofs_cipher_file,
480+ std::string& o_StrAdler32
481481 )
482482 {
483483 //------------------------------
@@ -627,11 +627,11 @@
627627 // Output key file (Subroutine of main_Encrypt)
628628 //
629629 void main_Encrypt_OutputKeyFile(
630- const std::vector<std::string> & i_AllEncryptionName,
631- const std::vector<CryptoPP::SecByteBlock> & i_AllEncryptionKey,
632- const std::vector<CryptoPP::SecByteBlock> & i_AllEncryptionIV,
633- const std::string & i_str_adler32_of_plain,
634- std::ofstream & io_ofs_key_file
630+ const std::vector<std::string>& i_AllEncryptionName,
631+ const std::vector<CryptoPP::SecByteBlock>& i_AllEncryptionKey,
632+ const std::vector<CryptoPP::SecByteBlock>& i_AllEncryptionIV,
633+ const std::string& i_str_adler32_of_plain,
634+ std::ofstream& io_ofs_key_file
635635 )
636636 {
637637 //--------------------
@@ -720,7 +720,7 @@
720720 // Get ofstream of plain file (Subroutine of main_Decrypt)
721721 //
722722 void main_Decrypt_Get_ofstream_of_plain(
723- std::ofstream & o_ofs_plain_file
723+ std::ofstream& o_ofs_plain_file
724724 )
725725 {
726726 std::wstring plain_file_name(m_PlainFileName);
@@ -764,9 +764,9 @@
764764 // Decrypt cipher data (Subroutine of main_Decrypt)
765765 //
766766 void main_Decrypt_DecryptCipherData(
767- const std::vector<TSharedPointer_StreamTransformation> & i_AllEncryptionHolder,
768- std::ofstream & o_ofs_plain_file,
769- std::string & o_StrAdler32
767+ const std::vector<TSharedPointer_StreamTransformation>& i_AllEncryptionHolder,
768+ std::ofstream& o_ofs_plain_file,
769+ std::string& o_StrAdler32
770770 )
771771 {
772772 //------------------------------
@@ -982,8 +982,8 @@
982982 // GetAllEncryptionNameAndKey (Subroutine of main_MakeSecondKey)
983983 //
984984 void main_MakeSecondKey_GetAllEncryptionNameAndKey(
985- std::vector<std::string> & o_AllEncryptionName,
986- std::vector<CryptoPP::SecByteBlock> & o_AllEncryptionKey
985+ std::vector<std::string>& o_AllEncryptionName,
986+ std::vector<CryptoPP::SecByteBlock>& o_AllEncryptionKey
987987 )
988988 {
989989 PresetEncryptionInfo preset_encryption_info;
@@ -993,7 +993,7 @@
993993 preset_encryption_info.GetAllItemName()
994994 );
995995
996- BOOST_FOREACH(const std::string & specified_encryption_name, all_item_name)
996+ BOOST_FOREACH(const std::string& specified_encryption_name, all_item_name)
997997 {
998998 PresetEncryptionInfoItem
999999 encryption_info_item =
@@ -1029,7 +1029,7 @@
10291029 // Get ofstream of second key file (Subroutine of main_MakeSecondKey)
10301030 //
10311031 void main_MakeSecondKey_Get_ofstream_of_second_key(
1032- std::ofstream & o_ofs_key_file
1032+ std::ofstream& o_ofs_key_file
10331033 )
10341034 {
10351035 std::wstring second_key_file_name(m_SecondKeyFileName);
@@ -1061,8 +1061,8 @@
10611061 // by insert into between basename and extension
10621062 //
10631063 void ChangeFilenameByInsertIntoBetweenBasenameAndExtension(
1064- const std::wstring & i_wstring_timestamp,
1065- std::wstring & io_wstring_filename
1064+ const std::wstring& i_wstring_timestamp,
1065+ std::wstring& io_wstring_filename
10661066 )
10671067 {
10681068 //--------------------
--- trunk/src/CscdEncr/AutoRemoveFilesWhenAbend.cpp (revision 16)
+++ trunk/src/CscdEncr/AutoRemoveFilesWhenAbend.cpp (revision 17)
@@ -35,8 +35,8 @@
3535 }
3636
3737 void AutoRemoveFilesWhenAbend::OpenOutputFile(
38- const std::wstring & i_FileName,
39- std::ofstream & o_ofs
38+ const std::wstring& i_FileName,
39+ std::ofstream& o_ofs
4040 )
4141 {
4242 m_AllFilePath.push_back(i_FileName);
@@ -54,7 +54,7 @@
5454
5555 void AutoRemoveFilesWhenAbend::RemoveAllFiles()
5656 {
57- BOOST_FOREACH(std::wstring & file_name, m_AllFilePath)
57+ BOOST_FOREACH(std::wstring& file_name, m_AllFilePath)
5858 {
5959 boost::filesystem::remove(file_name);
6060 }
--- trunk/src/CscdEncr/OptionOfCommandLineException.h (revision 16)
+++ trunk/src/CscdEncr/OptionOfCommandLineException.h (revision 17)
@@ -20,7 +20,7 @@
2020 class OptionOfCommandLineException : public std::exception
2121 {
2222 public:
23- explicit OptionOfCommandLineException(const std::string & i_What)
23+ explicit OptionOfCommandLineException(const std::string& i_What)
2424 : std::exception(i_What.c_str())
2525 {
2626 }
@@ -30,8 +30,8 @@
3030 }
3131
3232 //(use default)
33- //OptionOfCommandLineException(const OptionOfCommandLineException &);
33+ //OptionOfCommandLineException(const OptionOfCommandLineException&);
3434
3535 //(use default)
36- //OptionOfCommandLineException & operator =( const OptionOfCommandLineException & );
36+ //OptionOfCommandLineException& operator =( const OptionOfCommandLineException&);
3737 };
--- trunk/src/CscdEncr/ExceptionUnexpected.h (revision 16)
+++ trunk/src/CscdEncr/ExceptionUnexpected.h (revision 17)
@@ -28,8 +28,8 @@
2828 }
2929
3030 //(use default)
31- //ExceptionUnexpected(const ExceptionUnexpected &);
31+ //ExceptionUnexpected(const ExceptionUnexpected&);
3232
3333 //(use default)
34- //ExceptionUnexpected & operator =( const ExceptionUnexpected & );
34+ //ExceptionUnexpected& operator =( const ExceptionUnexpected&);
3535 };
--- trunk/src/CscdEncr/PresetEncryptionInfo.cpp (revision 16)
+++ trunk/src/CscdEncr/PresetEncryptionInfo.cpp (revision 17)
@@ -23,24 +23,24 @@
2323 namespace
2424 {
2525 //Block Cipher
26- const char *const ALGORITHM_NAME_AES = "aes";
27- const char *const ALGORITHM_NAME_BLOWFISH = "blowfish";
28- const char *const ALGORITHM_NAME_CAMELLIA = "camellia";
29- const char *const ALGORITHM_NAME_CAST256 = "cast256";
30-// const char *const ALGORITHM_NAME_MARS = "mars";
31- const char *const ALGORITHM_NAME_SERPENT = "serpent";
32- const char *const ALGORITHM_NAME_SHACAL2= "shacal2";
33- const char *const ALGORITHM_NAME_TWOFISH = "twofish";
26+ const char*const ALGORITHM_NAME_AES = "aes";
27+ const char*const ALGORITHM_NAME_BLOWFISH = "blowfish";
28+ const char*const ALGORITHM_NAME_CAMELLIA = "camellia";
29+ const char*const ALGORITHM_NAME_CAST256 = "cast256";
30+// const char*const ALGORITHM_NAME_MARS = "mars";
31+ const char*const ALGORITHM_NAME_SERPENT = "serpent";
32+ const char*const ALGORITHM_NAME_SHACAL2= "shacal2";
33+ const char*const ALGORITHM_NAME_TWOFISH = "twofish";
3434
3535 //Stream Cipher
36- const char *const ALGORITHM_NAME_XSALSA20 = "xsalsa20";
37- const char *const ALGORITHM_NAME_SOSEMANUK = "sosemanuk";
36+ const char*const ALGORITHM_NAME_XSALSA20 = "xsalsa20";
37+ const char*const ALGORITHM_NAME_SOSEMANUK = "sosemanuk";
3838 }
3939
4040 namespace
4141 {
42- const char *const MODE_NAME_NONE = "";
43- const char *const MODE_NAME_CTR = "ctr";
42+ const char*const MODE_NAME_NONE = "";
43+ const char*const MODE_NAME_CTR = "ctr";
4444 }
4545
4646
@@ -236,8 +236,8 @@
236236 //--------------------------------------------------
237237 // Get PresetEncryptionInfoItem by name
238238 //
239-const PresetEncryptionInfoItem & PresetEncryptionInfo::GetEncryptionInfoItem(
240- const std::string & i_ItemName
239+const PresetEncryptionInfoItem& PresetEncryptionInfo::GetEncryptionInfoItem(
240+ const std::string& i_ItemName
241241 ) const
242242 {
243243 TMap_EncryptionInfo::const_iterator pos;
@@ -257,10 +257,10 @@
257257 //
258258 TSharedPointer_StreamTransformation PresetEncryptionInfo::GetEncryption(
259259 bool i_FlagEncrypt,
260- const std::string & i_AlgorithmName,
261- const std::string & i_ModeName,
262- const CryptoPP::SecByteBlock & i_Key,
263- const CryptoPP::SecByteBlock & i_IV
260+ const std::string& i_AlgorithmName,
261+ const std::string& i_ModeName,
262+ const CryptoPP::SecByteBlock& i_Key,
263+ const CryptoPP::SecByteBlock& i_IV
264264 ) const
265265 {
266266 TSharedPointer_StreamTransformation encryption_info;
@@ -406,7 +406,7 @@
406406 {
407407 std::vector<std::string> all_item_name;
408408
409- BOOST_FOREACH(const TPair_EncryptionInfo & pair_item, m_EncryptionInfo)
409+ BOOST_FOREACH(const TPair_EncryptionInfo& pair_item, m_EncryptionInfo)
410410 {
411411 all_item_name.push_back(pair_item.first);
412412 }
@@ -419,12 +419,12 @@
419419 // Get all item name (same algorithm name)
420420 //
421421 std::vector<std::string> PresetEncryptionInfo::GetAllItemNameByAlgorithmName(
422- const std::string & i_AlgorithmName
422+ const std::string& i_AlgorithmName
423423 ) const
424424 {
425425 std::vector<std::string> all_item_name;
426426
427- BOOST_FOREACH(const TPair_EncryptionInfo & pair_item, m_EncryptionInfo)
427+ BOOST_FOREACH(const TPair_EncryptionInfo& pair_item, m_EncryptionInfo)
428428 {
429429 if(
430430 (pair_item.second).GetAlgorithmName()
@@ -447,7 +447,7 @@
447447 {
448448 std::vector<std::string> all_algorithm_name;
449449
450- BOOST_FOREACH(const TPair_AlgorithmNameToNumber & pair_item, m_AlgorithmNameToNumber)
450+ BOOST_FOREACH(const TPair_AlgorithmNameToNumber& pair_item, m_AlgorithmNameToNumber)
451451 {
452452 all_algorithm_name.push_back(pair_item.first);
453453 }
@@ -457,7 +457,7 @@
457457
458458
459459 PresetEncryptionInfo::AlgorithmNumber PresetEncryptionInfo::GetAlgorithmNumber(
460- const std::string & i_AlgorithmName
460+ const std::string& i_AlgorithmName
461461 ) const
462462 {
463463 TMap_AlgorithmNameToNumber::const_iterator pos;
@@ -474,7 +474,7 @@
474474 }
475475
476476 PresetEncryptionInfo::ModeNumber PresetEncryptionInfo::GetModeNumber(
477- const std::string & i_ModeName
477+ const std::string& i_ModeName
478478 ) const
479479 {
480480 TMap_ModeNameToNumber::const_iterator pos;
@@ -494,9 +494,9 @@
494494 void PresetEncryptionInfo::SetEncryptionInfoForBlockCipher(
495495 bool i_FlagEncrypt,
496496 ModeNumber i_ModeNumber,
497- const CryptoPP::SecByteBlock & i_Key,
498- const CryptoPP::SecByteBlock & i_IV,
499- TSharedPointer_StreamTransformation & io_EncryptionInfo
497+ const CryptoPP::SecByteBlock& i_Key,
498+ const CryptoPP::SecByteBlock& i_IV,
499+ TSharedPointer_StreamTransformation& io_EncryptionInfo
500500 ) const
501501 {
502502 switch(i_ModeNumber)
@@ -527,9 +527,9 @@
527527 template <typename i_TStreamCipher>
528528 void PresetEncryptionInfo::SetEncryptionInfoForStreamCipher(
529529 bool i_FlagEncrypt,
530- const CryptoPP::SecByteBlock & i_Key,
531- const CryptoPP::SecByteBlock & i_IV,
532- TSharedPointer_StreamTransformation & io_EncryptionInfo
530+ const CryptoPP::SecByteBlock& i_Key,
531+ const CryptoPP::SecByteBlock& i_IV,
532+ TSharedPointer_StreamTransformation& io_EncryptionInfo
533533 ) const
534534 {
535535 if(i_FlagEncrypt)
@@ -547,9 +547,9 @@
547547 }
548548
549549 void PresetEncryptionInfo::InsertEncryptionInfo(
550- const std::string & i_AlgorithmName,
550+ const std::string& i_AlgorithmName,
551551 int i_KeyLength,
552- const std::string & i_ModeName,
552+ const std::string& i_ModeName,
553553 int i_IVLength
554554 )
555555 {
@@ -578,7 +578,7 @@
578578 }
579579
580580 void PresetEncryptionInfo::InsertEncryptionInfoForBlockCipher(
581- const std::string & i_AlgorithmName,
581+ const std::string& i_AlgorithmName,
582582 int i_KeyLength,
583583 int i_IVLength
584584 )
--- trunk/src/CscdEncr/KeyFile.h (revision 16)
+++ trunk/src/CscdEncr/KeyFile.h (revision 17)
@@ -17,11 +17,11 @@
1717
1818 #include "KeyFileException.h"
1919
20-class KeyFile : boost::noncopyable
20+class KeyFile : private boost::noncopyable
2121 {
2222 public:
2323 explicit KeyFile(
24- const std::wstring & i_KeyFileName
24+ const std::wstring& i_KeyFileName
2525 );
2626
2727 ~KeyFile();
@@ -28,28 +28,28 @@
2828
2929 public:
3030 static void MakeOutputData(
31- const std::string & i_Version,
32- const std::vector<std::string> & i_AllEncryptionName,
33- const std::vector<CryptoPP::SecByteBlock> & i_AllEncryptionKey,
34- const std::vector<CryptoPP::SecByteBlock> & i_AllEncryptionIV,
31+ const std::string& i_Version,
32+ const std::vector<std::string>& i_AllEncryptionName,
33+ const std::vector<CryptoPP::SecByteBlock>& i_AllEncryptionKey,
34+ const std::vector<CryptoPP::SecByteBlock>& i_AllEncryptionIV,
3535 bool i_FlagCompress,
36- const std::string & i_Adler32OfPlainFile,
37- const std::wstring & i_PlainFileName,
38- std::stringstream & io_OutputData
36+ const std::string& i_Adler32OfPlainFile,
37+ const std::wstring& i_PlainFileName,
38+ std::stringstream& io_OutputData
3939 );
4040
4141 public:
42- const std::vector<std::string> & GetAllEncryptionName() const
42+ const std::vector<std::string>& GetAllEncryptionName() const
4343 {
4444 return m_AllEncryptionName;
4545 }
4646
47- const std::vector<std::string> & GetAllEncryptionKeyHex() const
47+ const std::vector<std::string>& GetAllEncryptionKeyHex() const
4848 {
4949 return m_AllEncryptionKeyHex;
5050 }
5151
52- const std::vector<std::string> & GetAllEncryptionIVHex() const
52+ const std::vector<std::string>& GetAllEncryptionIVHex() const
5353 {
5454 return m_AllEncryptionIVHex;
5555 }
@@ -59,12 +59,12 @@
5959 return m_FlagCompress;
6060 }
6161
62- const std::string & GetAdler32() const
62+ const std::string& GetAdler32() const
6363 {
6464 return m_Adler32;
6565 }
6666
67- const std::wstring & GetPlainFileName() const
67+ const std::wstring& GetPlainFileName() const
6868 {
6969 return m_PlainFileName;
7070 }
@@ -71,7 +71,7 @@
7171
7272 private:
7373 void ReadDataFromKeyFile(
74- std::basic_istream<char> & i_ifs_key_file
74+ std::basic_istream<char>& i_ifs_key_file
7575 );
7676
7777 private:
--- trunk/src/CscdEncr/OptionOfCommanLine.cpp (revision 16)
+++ trunk/src/CscdEncr/OptionOfCommanLine.cpp (revision 17)
@@ -28,28 +28,28 @@
2828
2929 namespace OptionName
3030 {
31- const char *const HELP = "help";
32- const char *const VERSION = "version";
31+ const char*const HELP = "help";
32+ const char*const VERSION = "version";
3333
34- const char *const COMMAND = "command";
34+ const char*const COMMAND = "command";
3535
36- const char *const PLAIN_FILE = "plain-file";
37- const char *const CIPHER_FILE = "cipher-file";
38- const char *const KEY_FILE = "key-file";
39- const char *const SECOND_KEY_FILE = "second-key-file";
36+ const char*const PLAIN_FILE = "plain-file";
37+ const char*const CIPHER_FILE = "cipher-file";
38+ const char*const KEY_FILE = "key-file";
39+ const char*const SECOND_KEY_FILE = "second-key-file";
4040
41- const char *const ADDITIONAL_ENTROPY = "additional-entropy";
42- const char *const COMPRESS = "compress";
43- const char *const ENCRYPTION_TIMES = "encryption-times";
41+ const char*const ADDITIONAL_ENTROPY = "additional-entropy";
42+ const char*const COMPRESS = "compress";
43+ const char*const ENCRYPTION_TIMES = "encryption-times";
4444
45- const char *const ENCRYPTION_NAME = "encryption-name";
46- const char *const ENCRYPTION_KEY_HEX = "encryption-key-hex";
47- const char *const ENCRYPTION_IV_HEX = "encryption-iv-hex";
45+ const char*const ENCRYPTION_NAME = "encryption-name";
46+ const char*const ENCRYPTION_KEY_HEX = "encryption-key-hex";
47+ const char*const ENCRYPTION_IV_HEX = "encryption-iv-hex";
4848
49- const char *const PLAIN_STDINOUT = "plain-stdinout";
50- const char *const CIPHER_STDINOUT = "cipher-stdinout";
49+ const char*const PLAIN_STDINOUT = "plain-stdinout";
50+ const char*const CIPHER_STDINOUT = "cipher-stdinout";
5151
52- const char *const ALWAYS_ADD_TIME_STAMP_TO_OUTPUT_FILENAME = "always-add-time-stamp-to-output-filename";
52+ const char*const ALWAYS_ADD_TIME_STAMP_TO_OUTPUT_FILENAME = "always-add-time-stamp-to-output-filename";
5353 }
5454
5555 namespace OptionValue
@@ -56,20 +56,20 @@
5656 {
5757 namespace COMMAND
5858 {
59- const char *const ENCRYPT = "encrypt";
60- const char *const DECRYPT = "decrypt";
61- const char *const MAKE_SECOND_KEY = "make-second-key";
59+ const char*const ENCRYPT = "encrypt";
60+ const char*const DECRYPT = "decrypt";
61+ const char*const MAKE_SECOND_KEY = "make-second-key";
6262 }
6363 namespace ADDITIONAL_ENTROPY
6464 {
65- const char *const KEYBOARD = "keyboard";
66- const char *const NONE = "none";
65+ const char*const KEYBOARD = "keyboard";
66+ const char*const NONE = "none";
6767 }
6868
6969 namespace COMPRESS
7070 {
71- const char *const DEFLATE = "deflate";
72- const char *const NONE = "none";
71+ const char*const DEFLATE = "deflate";
72+ const char*const NONE = "none";
7373 }
7474
7575 namespace ENCRYPTION_TIMES
@@ -80,31 +80,31 @@
8080
8181 namespace Delimiter
8282 {
83- const char *const COMMA = ",";
83+ const char*const COMMA = ",";
8484 }
8585
8686 namespace Prefix
8787 {
88- const char *const OPTION = "--";
88+ const char*const OPTION = "--";
8989 }
9090
9191 namespace HelpMessage
9292 {
93- const char *const CSV = "(Comma Separated Values)";
94- const char *const HEXADECIMAL = "(hexadecimal)";
93+ const char*const CSV = "(Comma Separated Values)";
94+ const char*const HEXADECIMAL = "(hexadecimal)";
9595
96- const char *const INDENT_SPACE_LEVEL_1 = " ";
96+ const char*const INDENT_SPACE_LEVEL_1 = " ";
9797 }
9898
9999 namespace FileExtension
100100 {
101- const _TCHAR *const CIPHER = L".cip";
102- const _TCHAR *const KEY = L".key";
101+ const _TCHAR*const CIPHER = L".cip";
102+ const _TCHAR*const KEY = L".key";
103103 }
104104
105105 namespace ErrorMessage
106106 {
107- const char *const SPACE = " ";
107+ const char*const SPACE = " ";
108108 }
109109
110110 std::string OptionOfCommandLine::m_HelpMessage;
@@ -114,7 +114,7 @@
114114 //
115115 OptionOfCommandLine::OptionOfCommandLine(
116116 int i_Argc,
117- _TCHAR * i_Argv[]
117+ _TCHAR* i_Argv[]
118118 )
119119 :
120120 m_Command(COMMAND_ENCRYPT),
@@ -355,12 +355,12 @@
355355 // Set to class member variables (Only m_HelpMessage)
356356 //----------------------------------------
357357 {
358- std::stringstream ss;
358+ std::ostringstream os;
359359
360- ss << "Usage: CscdEncr [options]\n";
361- ss << opt_desc_all;
360+ os << "Usage: CscdEncr [options]\n";
361+ os << opt_desc_all;
362362
363- m_HelpMessage = ss.str();
363+ m_HelpMessage = os.str();
364364 }
365365
366366 //----------------------------------------
@@ -373,7 +373,7 @@
373373 command_line_var_map
374374 );
375375 }
376- catch(boost::program_options::error &e)
376+ catch(boost::program_options::error& e)
377377 {
378378 throw OptionOfCommandLineException(e.what());
379379 }
@@ -497,7 +497,7 @@
497497 m_AllEncryptionIVHex
498498 );
499499 }
500- catch(FunctionsKeyDataException &e)
500+ catch(FunctionsKeyDataException& e)
501501 {
502502 throw OptionOfCommandLineException(e.what());
503503 }
@@ -603,13 +603,12 @@
603603 m_SecondKeyFileName,
604604 OptionName::SECOND_KEY_FILE
605605 );
606- }
607-
608- if(m_WhereIsSecondKeyFile == WHERE_IS_SECOND_KEY_FILE_SPECIFY_FILE_NAME)
609- {
610- SecondKeyFile second_key_file(m_SecondKeyFileName);
611606
612- m_Map_Addition_EncryptionName_KeyHex = second_key_file.GetMap_Addition_EncryptionName_KeyHex();
607+ {
608+ SecondKeyFile second_key_file(m_SecondKeyFileName);
609+
610+ m_Map_Addition_EncryptionName_KeyHex = second_key_file.GetMap_Addition_EncryptionName_KeyHex();
611+ }
613612 }
614613
615614 if(
@@ -644,7 +643,7 @@
644643 }
645644
646645 void OptionOfCommandLine::SetAdditionalEntropy(
647- const std::string & i_AdditionalEntropy
646+ const std::string& i_AdditionalEntropy
648647 )
649648 {
650649 m_AdditionalEntropy = ADDITIONAL_ENTROPY_NONE;
@@ -657,7 +656,7 @@
657656
658657 void OptionOfCommandLine::SetWhereIsPlainFile(
659658 bool i_flg_plain_stdinout,
660- WhereIsPlainFile & o_WhereIsPlainFile
659+ WhereIsPlainFile& o_WhereIsPlainFile
661660 ) const
662661 {
663662 o_WhereIsPlainFile = WHERE_IS_PLAIN_FILE_SPECIFY_FILE_NAME;
@@ -680,7 +679,7 @@
680679
681680 void OptionOfCommandLine::SetWhereIsCipherFile(
682681 bool i_flg_cipher_stdinout,
683- WhereIsCipherFile & o_WhereIsCipherFile
682+ WhereIsCipherFile& o_WhereIsCipherFile
684683 ) const
685684 {
686685 o_WhereIsCipherFile = WHERE_IS_CIPHER_FILE_SPECIFY_FILE_NAME;
@@ -703,8 +702,8 @@
703702
704703 void OptionOfCommandLine::SetWhereIsKeyFile_And_WhereIsKeyData(
705704 bool i_IsValidKeyDataSpecifyDirect,
706- WhereIsKeyFile & o_WhereIsKeyFile,
707- WhereIsKeyData & o_WhereIsKeyData
705+ WhereIsKeyFile& o_WhereIsKeyFile,
706+ WhereIsKeyData& o_WhereIsKeyData
708707 ) const
709708 {
710709 if(i_IsValidKeyDataSpecifyDirect)
@@ -720,8 +719,8 @@
720719 }
721720
722721 void OptionOfCommandLine::SetWhereIsSecondKeyFile(
723- const std::wstring & i_SecondKeyFileName,
724- WhereIsSecondKeyFile & o_WhereIsSecondKeyFile
722+ const std::wstring& i_SecondKeyFileName,
723+ WhereIsSecondKeyFile& o_WhereIsSecondKeyFile
725724 ) const
726725 {
727726 if(i_SecondKeyFileName.empty())
@@ -738,9 +737,9 @@
738737 // Generate file name Automatically
739738 //
740739 void OptionOfCommandLine::AutoGenerateFileName(
741- std::wstring & io_PlainFileName,
742- std::wstring & io_CipherFileName,
743- std::wstring & io_KeyFileName
740+ std::wstring& io_PlainFileName,
741+ std::wstring& io_CipherFileName,
742+ std::wstring& io_KeyFileName
744743 ) const
745744 {
746745 switch(m_Command)
@@ -773,9 +772,9 @@
773772 // (from plain file name)
774773 //
775774 void OptionOfCommandLine::AutoGenerateFileName_From_PlainFileName(
776- const std::wstring & i_PlainFileName,
777- std::wstring & io_CipherFileName,
778- std::wstring & io_KeyFileName
775+ const std::wstring& i_PlainFileName,
776+ std::wstring& io_CipherFileName,
777+ std::wstring& io_KeyFileName
779778 ) const
780779 {
781780 std::wstring plain_file_name(
@@ -824,10 +823,10 @@
824823 // Generate plain file name Automatically
825824 //
826825 void OptionOfCommandLine::AutoGeneratePlainFileName(
827- const std::wstring & i_PlainFileNameOfKeyFile,
828- const std::wstring & i_CipherFileName,
829- const std::wstring & i_KeyFileName,
830- std::wstring & io_PlainFileName
826+ const std::wstring& i_PlainFileNameOfKeyFile,
827+ const std::wstring& i_CipherFileName,
828+ const std::wstring& i_KeyFileName,
829+ std::wstring& io_PlainFileName
831830 ) const
832831 {
833832 if(m_WhereIsKeyFile == WHERE_IS_KEY_FILE_SPECIFY_FILE_NAME)
@@ -850,9 +849,9 @@
850849 {
851850 if(io_PlainFileName.empty())
852851 {
853- std::stringstream ss;
852+ std::ostringstream os;
854853 {
855- ss
854+ os
856855 <<
857856 MakeErrorMessage_CannotGetPlainFileNameAutomatically()
858857 << std::endl
@@ -863,7 +862,7 @@
863862 ;
864863 }
865864
866- throw OptionOfCommandLineException(ss.str());
865+ throw OptionOfCommandLineException(os.str());
867866 }
868867 }
869868
@@ -871,7 +870,7 @@
871870
872871
873872 bool OptionOfCommandLine::IsValidKeyDataSpecifyDirect(
874- const boost::program_options::variables_map & i_CommandLineVarMap
873+ const boost::program_options::variables_map& i_CommandLineVarMap
875874 ) const
876875 {
877876 if(
@@ -904,8 +903,8 @@
904903 // Throw exception if it is not regular file name.
905904 //
906905 void OptionOfCommandLine::ThrowExceptionIfItIsNotRegularFileName(
907- const std::wstring & i_FileName,
908- const std::string & i_OptionName
906+ const std::wstring& i_FileName,
907+ const std::string& i_OptionName
909908 ) const
910909 {
911910 if(i_FileName.empty())
@@ -934,9 +933,9 @@
934933
935934 std::string OptionOfCommandLine::MakeAndGetPartOfHelpMessage_COMMAND() const
936935 {
937- std::stringstream ss;
936+ std::ostringstream os;
938937
939- ss
938+ os
940939 << OptionValue::COMMAND::ENCRYPT
941940 << std::endl
942941 << OptionValue::COMMAND::DECRYPT
@@ -944,58 +943,58 @@
944943 << OptionValue::COMMAND::MAKE_SECOND_KEY
945944 ;
946945
947- return ss.str();
946+ return os.str();
948947 }
949948
950949 std::string OptionOfCommandLine::MakeAndGetPartOfHelpMessage_PLAIN_FILE() const
951950 {
952- std::stringstream ss;
951+ std::ostringstream os;
953952
954- ss
953+ os
955954 << "plain file name"
956955 ;
957956
958- return ss.str();
957+ return os.str();
959958 }
960959
961960 std::string OptionOfCommandLine::MakeAndGetPartOfHelpMessage_CIPHER_FILE() const
962961 {
963- std::stringstream ss;
962+ std::ostringstream os;
964963
965- ss
964+ os
966965 << "cipher file name"
967966 ;
968967
969- return ss.str();
968+ return os.str();
970969 }
971970
972971 std::string OptionOfCommandLine::MakeAndGetPartOfHelpMessage_KEY_FILE() const
973972 {
974- std::stringstream ss;
973+ std::ostringstream os;
975974
976- ss
975+ os
977976 << "key file name"
978977 ;
979978
980- return ss.str();
979+ return os.str();
981980 }
982981
983982 std::string OptionOfCommandLine::MakeAndGetPartOfHelpMessage_SECOND_KEY_FILE() const
984983 {
985- std::stringstream ss;
984+ std::ostringstream os;
986985
987- ss
986+ os
988987 << "second key file name"
989988 ;
990989
991- return ss.str();
990+ return os.str();
992991 }
993992
994993 std::string OptionOfCommandLine::MakeAndGetPartOfHelpMessage_ENCRYPTION_TIMES() const
995994 {
996- std::stringstream ss;
995+ std::ostringstream os;
997996
998- ss
997+ os
999998 << "number of times of encryption"
1000999 << std::endl
10011000 << HelpMessage::INDENT_SPACE_LEVEL_1
@@ -1003,13 +1002,13 @@
10031002 << PresetEncryptionInfo::ALGORITHM_NUMBER_COUNT
10041003 ;
10051004
1006- return ss.str();
1005+ return os.str();
10071006 }
10081007
10091008
10101009 std::string OptionOfCommandLine::MakeAndGetPartOfHelpMessage_ENCRYPTION_NAME() const
10111010 {
1012- std::stringstream ss;
1011+ std::ostringstream os;
10131012
10141013 {
10151014 PresetEncryptionInfo preset_encryption_info;
@@ -1016,42 +1015,42 @@
10161015
10171016 BOOST_FOREACH(std::string item_name, preset_encryption_info.GetAllItemName())
10181017 {
1019- ss << item_name << std::endl;
1018+ os << item_name << std::endl;
10201019 }
10211020 }
10221021
1023- ss
1022+ os
10241023 << HelpMessage::INDENT_SPACE_LEVEL_1
10251024 << HelpMessage::CSV
10261025 ;
10271026
1028- return ss.str();
1027+ return os.str();
10291028 }
10301029
10311030 std::string OptionOfCommandLine::MakeAndGetPartOfHelpMessage_ADDITIONAL_ENTROPY() const
10321031 {
1033- std::stringstream ss;
1032+ std::ostringstream os;
10341033
1035- ss
1034+ os
10361035 << OptionValue::ADDITIONAL_ENTROPY::KEYBOARD
10371036 << std::endl
10381037 << OptionValue::ADDITIONAL_ENTROPY::NONE
10391038 ;
10401039
1041- return ss.str();
1040+ return os.str();
10421041 }
10431042
10441043 std::string OptionOfCommandLine::MakeAndGetPartOfHelpMessage_COMPRESS() const
10451044 {
1046- std::stringstream ss;
1045+ std::ostringstream os;
10471046
1048- ss
1047+ os
10491048 << OptionValue::COMPRESS::DEFLATE
10501049 << std::endl
10511050 << OptionValue::COMPRESS::NONE
10521051 ;
10531052
1054- return ss.str();
1053+ return os.str();
10551054 }
10561055
10571056
@@ -1058,9 +1057,9 @@
10581057
10591058 std::string OptionOfCommandLine::MakeAndGetPartOfHelpMessage_ENCRYPTION_KEY_HEX() const
10601059 {
1061- std::stringstream ss;
1060+ std::ostringstream os;
10621061
1063- ss
1062+ os
10641063 << "key"
10651064 << std::endl
10661065 << HelpMessage::INDENT_SPACE_LEVEL_1
@@ -1070,15 +1069,15 @@
10701069 << HelpMessage::CSV
10711070 ;
10721071
1073- return ss.str();
1072+ return os.str();
10741073 }
10751074
10761075
10771076 std::string OptionOfCommandLine::MakeAndGetPartOfHelpMessage_ENCRYPTION_IV_HEX() const
10781077 {
1079- std::stringstream ss;
1078+ std::ostringstream os;
10801079
1081- ss
1080+ os
10821081 << "IV or nonce"
10831082 << std::endl
10841083 << HelpMessage::INDENT_SPACE_LEVEL_1
@@ -1088,54 +1087,54 @@
10881087 << HelpMessage::CSV
10891088 ;
10901089
1091- return ss.str();
1090+ return os.str();
10921091 }
10931092
10941093
10951094 std::string OptionOfCommandLine::MakeAndGetPartOfHelpMessage_PLAIN_STDINOUT() const
10961095 {
1097- std::stringstream ss;
1096+ std::ostringstream os;
10981097
1099- ss
1098+ os
11001099 << "use stdin or stdout for plain"
11011100 ;
11021101
1103- return ss.str();
1102+ return os.str();
11041103 }
11051104
11061105
11071106 std::string OptionOfCommandLine::MakeAndGetPartOfHelpMessage_CIPHER_STDINOUT() const
11081107 {
1109- std::stringstream ss;
1108+ std::ostringstream os;
11101109
1111- ss
1110+ os
11121111 << "use stdin or stdout for cipher"
11131112 ;
11141113
1115- return ss.str();
1114+ return os.str();
11161115 }
11171116
11181117
11191118 std::string OptionOfCommandLine::MakeAndGetPartOfHelpMessage_ALWAYS_ADD_TIME_STAMP_TO_OUTPUT_FILENAME() const
11201119 {
1121- std::stringstream ss;
1120+ std::ostringstream os;
11221121
1123- ss
1122+ os
11241123 << "always add time stamp to output filename"
11251124 ;
11261125
1127- return ss.str();
1126+ return os.str();
11281127 }
11291128
11301129
11311130 std::string OptionOfCommandLine::MakeErrorMessage_Option(
1132- const std::string & i_OptionName,
1133- const std::string & i_OptionValue
1131+ const std::string& i_OptionName,
1132+ const std::string& i_OptionValue
11341133 ) const
11351134 {
1136- std::stringstream ss;
1135+ std::ostringstream os;
11371136
1138- ss
1137+ os
11391138 << Prefix::OPTION
11401139 << i_OptionName
11411140 << ErrorMessage::SPACE
@@ -1142,16 +1141,16 @@
11421141 << i_OptionValue
11431142 ;
11441143
1145- return ss.str();
1144+ return os.str();
11461145 }
11471146
11481147 std::string OptionOfCommandLine::MakeErrorMessage_PleaseSetOption(
1149- const std::string & i_OptionName
1148+ const std::string& i_OptionName
11501149 ) const
11511150 {
1152- std::stringstream ss;
1151+ std::ostringstream os;
11531152
1154- ss
1153+ os
11551154 << "Please set"
11561155 << ErrorMessage::SPACE
11571156 << Prefix::OPTION
@@ -1158,29 +1157,29 @@
11581157 << i_OptionName
11591158 ;
11601159
1161- return ss.str();
1160+ return os.str();
11621161 }
11631162
11641163 std::string OptionOfCommandLine::MakeErrorMessage_CannotGetEncryptionInformation_Name_Key_IV() const
11651164 {
1166- std::stringstream ss;
1165+ std::ostringstream os;
11671166
1168- ss
1167+ os
11691168 << "Cannot get encryption information (name / key / iv ) "
11701169 ;
11711170
1172- return ss.str();
1171+ return os.str();
11731172 }
11741173
11751174
11761175 std::string OptionOfCommandLine::MakeErrorMessage_PleaseSetRegularFileName(
1177- const std::string & i_OptionName,
1178- const std::string & i_OptionValue
1176+ const std::string& i_OptionName,
1177+ const std::string& i_OptionValue
11791178 ) const
11801179 {
1181- std::stringstream ss;
1180+ std::ostringstream os;
11821181
1183- ss
1182+ os
11841183 << "Please set regular file name."
11851184 << std::endl
11861185 << Prefix::OPTION
@@ -1189,19 +1188,19 @@
11891188 << i_OptionValue
11901189 ;
11911190
1192- return ss.str();
1191+ return os.str();
11931192 }
11941193
11951194
11961195 std::string OptionOfCommandLine::MakeErrorMessage_CannotGetPlainFileNameAutomatically() const
11971196 {
1198- std::stringstream ss;
1197+ std::ostringstream os;
11991198
1200- ss
1199+ os
12011200 << "Cannot get plain file name automatically."
12021201 ;
12031202
1204- return ss.str();
1203+ return os.str();
12051204 }
12061205
12071206
--- trunk/src/CscdEncr/DecryptionInfo.h (revision 16)
+++ trunk/src/CscdEncr/DecryptionInfo.h (revision 17)
@@ -18,20 +18,20 @@
1818 #include "PresetEncryptionInfo.h"
1919 #include "OptionOfCommandLine.h"
2020
21-class DecryptionInfo : boost::noncopyable
21+class DecryptionInfo : private boost::noncopyable
2222 {
2323 public:
2424 DecryptionInfo(
25- const std::vector<std::string> & i_AllSpecifiedEncryptionName,
26- const std::vector<std::string> & i_AllEncryptionKeyHex,
27- const std::vector<std::string> & i_AllEncryptionIVHex,
28- const std::map<std::string, std::string> & i_map_EncryptionName_KeyHex
25+ const std::vector<std::string>& i_AllSpecifiedEncryptionName,
26+ const std::vector<std::string>& i_AllEncryptionKeyHex,
27+ const std::vector<std::string>& i_AllEncryptionIVHex,
28+ const std::map<std::string, std::string>& i_map_EncryptionName_KeyHex
2929 );
3030
3131 ~DecryptionInfo();
3232
3333 public:
34- const std::vector<TSharedPointer_StreamTransformation> & GetAllEncryptionHolder() const
34+ const std::vector<TSharedPointer_StreamTransformation>& GetAllEncryptionHolder() const
3535 {
3636 return m_AllEncryptionHolder;
3737 }
@@ -42,9 +42,9 @@
4242 std::vector<TSharedPointer_StreamTransformation> m_AllEncryptionHolder;
4343
4444 private:
45- const std::string & DecryptionInfo::GetKeyHexFrom_map_EncryptionName_KeyHex(
46- const std::map<std::string, std::string> & i_map_EncryptionName_KeyHex,
47- const std::string & i_EncryptionName
45+ const std::string& DecryptionInfo::GetKeyHexFrom_map_EncryptionName_KeyHex(
46+ const std::map<std::string, std::string>& i_map_EncryptionName_KeyHex,
47+ const std::string& i_EncryptionName
4848 ) const;
4949
5050 };
--- trunk/src/CscdEncr/EncryptionInfo.cpp (revision 16)
+++ trunk/src/CscdEncr/EncryptionInfo.cpp (revision 17)
@@ -21,10 +21,10 @@
2121 #include "CommonLastInclude.h"
2222
2323 EncryptionInfo::EncryptionInfo(
24- const std::vector<std::string> & i_AllSpecifiedEncryptionName,
25- const std::vector<std::string> & i_AllEncryptionKeyHex,
26- const std::vector<std::string> & i_AllEncryptionIVHex,
27- const std::map<std::string, std::string> & i_map_EncryptionName_KeyHex,
24+ const std::vector<std::string>& i_AllSpecifiedEncryptionName,
25+ const std::vector<std::string>& i_AllEncryptionKeyHex,
26+ const std::vector<std::string>& i_AllEncryptionIVHex,
27+ const std::map<std::string, std::string>& i_map_EncryptionName_KeyHex,
2828 OptionOfCommandLine::AdditionalEntropy i_AdditionalEntropy,
2929 int i_EncryptionTimes
3030 )
@@ -38,7 +38,7 @@
3838
3939 std::vector<std::string> all_specified_encryption_name_random;
4040
41- const std::vector<std::string> * pAllSpecifiedEncryptionName;
41+ const std::vector<std::string>* pAllSpecifiedEncryptionName;
4242
4343 //------------------------------
4444 // Get AllSpecifiedEncryptionName
@@ -124,7 +124,7 @@
124124 ++counter_encription
125125 )
126126 {
127- const std::string &
127+ const std::string&
128128 specified_encryption_name =
129129 pAllSpecifiedEncryptionName->at(counter_encription)
130130 ;
@@ -206,9 +206,9 @@
206206 //--------------------------------------------------
207207 // Get KeyHex from map_EncryptionName_KeyHex
208208 //
209-const std::string & EncryptionInfo::GetKeyHexFrom_map_EncryptionName_KeyHex(
210- const std::map<std::string, std::string> & i_map_EncryptionName_KeyHex,
211- const std::string & i_EncryptionName
209+const std::string& EncryptionInfo::GetKeyHexFrom_map_EncryptionName_KeyHex(
210+ const std::map<std::string, std::string>& i_map_EncryptionName_KeyHex,
211+ const std::string& i_EncryptionName
212212 ) const
213213 {
214214 std::map<std::string, std::string>::const_iterator pos;
--- trunk/src/CscdEncr/PresetEncryptionInfoItem.cpp (revision 16)
+++ trunk/src/CscdEncr/PresetEncryptionInfoItem.cpp (revision 17)
@@ -20,9 +20,9 @@
2020 #include "CommonLastInclude.h"
2121
2222 PresetEncryptionInfoItem::PresetEncryptionInfoItem(
23- const std::string & i_AlgorithmName,
23+ const std::string& i_AlgorithmName,
2424 int i_KeyLength,
25- const std::string & i_ModeName,
25+ const std::string& i_ModeName,
2626 int i_IVLength
2727 )
2828 :
--- trunk/src/CscdEncr/SecondKeyFileException.h (revision 16)
+++ trunk/src/CscdEncr/SecondKeyFileException.h (revision 17)
@@ -20,7 +20,7 @@
2020 class SecondKeyFileException : public std::exception
2121 {
2222 public:
23- explicit SecondKeyFileException(const std::string & i_What)
23+ explicit SecondKeyFileException(const std::string& i_What)
2424 : std::exception(i_What.c_str())
2525 {
2626 }
@@ -30,8 +30,8 @@
3030 }
3131
3232 //(use default)
33- //SecondKeyFileException(const SecondKeyFileException &);
33+ //SecondKeyFileException(const SecondKeyFileException&);
3434
3535 //(use default)
36- //SecondKeyFileException & operator =( const SecondKeyFileException & );
36+ //SecondKeyFileException& operator =( const SecondKeyFileException&);
3737 };
--- trunk/src/CscdEncr/OptionOfCommandLine.h (revision 16)
+++ trunk/src/CscdEncr/OptionOfCommandLine.h (revision 17)
@@ -17,12 +17,12 @@
1717
1818 #include "OptionOfCommandLineException.h"
1919
20-class OptionOfCommandLine : boost::noncopyable
20+class OptionOfCommandLine : private boost::noncopyable
2121 {
2222 public:
2323 OptionOfCommandLine(
2424 int i_Argc,
25- _TCHAR * i_Argv[]
25+ _TCHAR* i_Argv[]
2626 );
2727
2828 ~OptionOfCommandLine();
@@ -76,11 +76,14 @@
7676 };
7777
7878 public:
79- static const std::string & GetHelpMessage()
79+ static const std::string& GetHelpMessage()
8080 {
8181 return m_HelpMessage;
8282 }
8383
84+private:
85+ static std::string m_HelpMessage;
86+
8487 public:
8588 Command GetCommand() const
8689 {
@@ -87,22 +90,22 @@
8790 return m_Command;
8891 }
8992
90- const std::wstring & GetPlainFileName() const
93+ const std::wstring& GetPlainFileName() const
9194 {
9295 return m_PlainFileName;
9396 }
9497
95- const std::wstring & GetCipherFileName() const
98+ const std::wstring& GetCipherFileName() const
9699 {
97100 return m_CipherFileName;
98101 }
99102
100- const std::wstring & GetKeyFileName() const
103+ const std::wstring& GetKeyFileName() const
101104 {
102105 return m_KeyFileName;
103106 }
104107
105- const std::wstring & GetSecondKeyFileName() const
108+ const std::wstring& GetSecondKeyFileName() const
106109 {
107110 return m_SecondKeyFileName;
108111 }
@@ -152,80 +155,77 @@
152155 return m_WhereIsSecondKeyFile;
153156 }
154157
155- const std::vector<std::string> & GetAllSpecifiedEncryptionName() const
158+ const std::vector<std::string>& GetAllSpecifiedEncryptionName() const
156159 {
157160 return m_AllSpecifiedEncryptionName;
158161 }
159162
160- const std::vector<std::string> & GetAllEncryptionKeyHex() const
163+ const std::vector<std::string>& GetAllEncryptionKeyHex() const
161164 {
162165 return m_AllEncryptionKeyHex;
163166 }
164167
165- const std::vector<std::string> & GetAllEncryptionIVHex() const
168+ const std::vector<std::string>& GetAllEncryptionIVHex() const
166169 {
167170 return m_AllEncryptionIVHex;
168171 }
169172
170- const std::string & GetAdler32OfPlainFile() const
173+ const std::string& GetAdler32OfPlainFile() const
171174 {
172175 return m_Adler32OfPlainFile;
173176 }
174177
175- const std::map<std::string, std::string> & GetMap_Addition_EncryptionName_KeyHex() const
178+ const std::map<std::string, std::string>& GetMap_Addition_EncryptionName_KeyHex() const
176179 {
177180 return m_Map_Addition_EncryptionName_KeyHex;
178181 }
179182
180183 private:
181- static std::string m_HelpMessage;
182-
183-private:
184184 void SetAdditionalEntropy(
185- const std::string & i_AdditionalEntropy
185+ const std::string& i_AdditionalEntropy
186186 );
187187 void SetWhereIsPlainFile(
188188 bool i_flg_plain_stdinout,
189- WhereIsPlainFile & o_WhereIsPlainFile
189+ WhereIsPlainFile& o_WhereIsPlainFile
190190 ) const;
191191 void SetWhereIsCipherFile(
192192 bool i_flg_cipher_stdinout,
193- WhereIsCipherFile & o_WhereIsCipherFile
193+ WhereIsCipherFile& o_WhereIsCipherFile
194194 ) const;
195195 void SetWhereIsKeyFile_And_WhereIsKeyData(
196196 bool i_IsValidKeyDataSpecifyDirect,
197- WhereIsKeyFile & o_WhereIsKeyFile,
198- WhereIsKeyData & o_WhereIsKeyData
197+ WhereIsKeyFile& o_WhereIsKeyFile,
198+ WhereIsKeyData& o_WhereIsKeyData
199199 ) const;
200200 void SetWhereIsSecondKeyFile(
201- const std::wstring & i_SecondKeyFileName,
202- WhereIsSecondKeyFile & o_WhereIsSecondKeyFile
201+ const std::wstring& i_SecondKeyFileName,
202+ WhereIsSecondKeyFile& o_WhereIsSecondKeyFile
203203 ) const;
204204
205205 void AutoGenerateFileName(
206- std::wstring & io_PlainFileName,
207- std::wstring & io_CipherFileName,
208- std::wstring & io_KeyFileName
206+ std::wstring& io_PlainFileName,
207+ std::wstring& io_CipherFileName,
208+ std::wstring& io_KeyFileName
209209 ) const;
210210 void AutoGenerateFileName_From_PlainFileName(
211- const std::wstring & i_PlainFileName,
212- std::wstring & io_CipherFileName,
213- std::wstring & io_KeyFileName
211+ const std::wstring& i_PlainFileName,
212+ std::wstring& io_CipherFileName,
213+ std::wstring& io_KeyFileName
214214 ) const;
215215 void AutoGeneratePlainFileName(
216- const std::wstring & i_PlainFileNameOfKeyFile,
217- const std::wstring & i_CipherFileName,
218- const std::wstring & i_KeyFileName,
219- std::wstring & io_PlainFileName
216+ const std::wstring& i_PlainFileNameOfKeyFile,
217+ const std::wstring& i_CipherFileName,
218+ const std::wstring& i_KeyFileName,
219+ std::wstring& io_PlainFileName
220220 ) const;
221221
222222 bool IsValidKeyDataSpecifyDirect(
223- const boost::program_options::variables_map & i_CommandLineVarMap
223+ const boost::program_options::variables_map& i_CommandLineVarMap
224224 ) const ;
225225
226226 void ThrowExceptionIfItIsNotRegularFileName(
227- const std::wstring & i_FileName,
228- const std::string & i_OptionName
227+ const std::wstring& i_FileName,
228+ const std::string& i_OptionName
229229 ) const;
230230
231231 std::string MakeAndGetPartOfHelpMessage_COMMAND() const;
@@ -244,19 +244,19 @@
244244 std::string MakeAndGetPartOfHelpMessage_ALWAYS_ADD_TIME_STAMP_TO_OUTPUT_FILENAME() const;
245245
246246 std::string MakeErrorMessage_Option(
247- const std::string & i_OptionName,
248- const std::string & i_OptionValue
247+ const std::string& i_OptionName,
248+ const std::string& i_OptionValue
249249 ) const;
250250
251251 std::string MakeErrorMessage_PleaseSetOption(
252- const std::string & i_OptionName
252+ const std::string& i_OptionName
253253 ) const;
254254
255255 std::string MakeErrorMessage_CannotGetEncryptionInformation_Name_Key_IV() const;
256256
257257 std::string MakeErrorMessage_PleaseSetRegularFileName(
258- const std::string & i_OptionName,
259- const std::string & i_OptionValue
258+ const std::string& i_OptionName,
259+ const std::string& i_OptionValue
260260 ) const;
261261
262262 std::string MakeErrorMessage_CannotGetPlainFileNameAutomatically() const;
--- trunk/src/CscdEncr/Functions.h (revision 16)
+++ trunk/src/CscdEncr/Functions.h (revision 17)
@@ -21,11 +21,11 @@
2121 const int SIZE_OF_HEX_STRING_PER_BYTE = 2;
2222
2323 std::string Get_string_UTF8_From_wstring_UTF16(
24- const std::wstring & i_wstring
24+ const std::wstring& i_wstring
2525 );
2626
2727 std::wstring Get_wstring_UTF16_From_string_UTF8(
28- const std::string & i_string_UTF8
28+ const std::string& i_string_UTF8
2929 );
3030
3131 byte GetRandomNumberByte(
@@ -34,23 +34,23 @@
3434
3535 void CreateKeyAndIV(
3636 OptionOfCommandLine::AdditionalEntropy i_AdditionalEntropy,
37- CryptoPP::SecByteBlock & o_Key,
38- CryptoPP::SecByteBlock & o_IV
37+ CryptoPP::SecByteBlock& o_Key,
38+ CryptoPP::SecByteBlock& o_IV
3939 );
4040
4141 void GetSecByteBlockFromHexString(
42- const std::string & i_HexString,
43- CryptoPP::SecByteBlock & o_SecByteBlock
42+ const std::string& i_HexString,
43+ CryptoPP::SecByteBlock& o_SecByteBlock
4444 );
4545
4646 void GetHexStringFromSecByteBlock(
47- const CryptoPP::SecByteBlock & i_SecByteBlock,
48- std::string & o_HexString
47+ const CryptoPP::SecByteBlock& i_SecByteBlock,
48+ std::string& o_HexString
4949 );
5050
5151 CryptoPP::SecByteBlock GetModifiedKey(
52- const std::string & i_HexStringOfAdditionKey,
53- const CryptoPP::SecByteBlock & i_Key
52+ const std::string& i_HexStringOfAdditionKey,
53+ const CryptoPP::SecByteBlock& i_Key
5454 );
5555
5656 }
--- trunk/src/CscdEncr/FunctionsKeyData.h (revision 16)
+++ trunk/src/CscdEncr/FunctionsKeyData.h (revision 17)
@@ -17,10 +17,10 @@
1717 namespace FunctionsKeyData
1818 {
1919 void SetEncryptionRelatedData(
20- const std::string & i_VarName,
21- const std::string & i_VarValueCSV,
22- const std::string & i_VarName_EncryptionName,
20+ const std::string& i_VarName,
21+ const std::string& i_VarValueCSV,
22+ const std::string& i_VarName_EncryptionName,
2323 int i_Count_EncryptionName,
24- std::vector<std::string> & o_AllData
24+ std::vector<std::string>& o_AllData
2525 );
2626 }
--- trunk/src/CscdEncr/ExceptionResultOfDecryptionIsBroken.h (revision 16)
+++ trunk/src/CscdEncr/ExceptionResultOfDecryptionIsBroken.h (revision 17)
@@ -29,8 +29,8 @@
2929 }
3030
3131 //(use default)
32- //ExceptionResultOfDecryptionIsBroken(const ExceptionResultOfDecryptionIsBroken &);
32+ //ExceptionResultOfDecryptionIsBroken(const ExceptionResultOfDecryptionIsBroken&);
3333
3434 //(use default)
35- //ExceptionResultOfDecryptionIsBroken & operator =( const ExceptionResultOfDecryptionIsBroken & );
35+ //ExceptionResultOfDecryptionIsBroken& operator =( const ExceptionResultOfDecryptionIsBroken& );
3636 };
--- trunk/src/CscdEncr/Version.cpp (revision 16)
+++ trunk/src/CscdEncr/Version.cpp (revision 17)
@@ -24,14 +24,14 @@
2424
2525 std::string GetVersionString()
2626 {
27- std::stringstream ss;
27+ std::ostringstream os;
2828
29- ss
29+ os
3030 << "Cascade Encryptor 2009 version 1.000"
3131 << " " << "(" << __DATE__ << " " << __TIME__ << ")"
3232 ;
3333
34- return ss.str();
34+ return os.str();
3535 }
3636
3737 }
--- trunk/src/CscdEncr/FunctionsKeyFile.h (revision 16)
+++ trunk/src/CscdEncr/FunctionsKeyFile.h (revision 17)
@@ -18,31 +18,31 @@
1818 {
1919 namespace Delimiter
2020 {
21- const char *const EQUAL = "=";
22- const char *const COMMA = ",";
21+ const char*const EQUAL = "=";
22+ const char*const COMMA = ",";
2323 }
2424
2525 namespace ErrorMessage
2626 {
27- const char *const SPACE = " ";
27+ const char*const SPACE = " ";
2828 }
2929
3030 void OutputVarHexValueCSV(
31- const std::string & i_VarName,
32- const std::vector<CryptoPP::SecByteBlock> & i_AllValue,
33- std::stringstream & io_OutputData
31+ const std::string& i_VarName,
32+ const std::vector<CryptoPP::SecByteBlock>& i_AllValue,
33+ std::stringstream& io_OutputData
3434 );
3535
3636 void ConfirmExistenceOfRequiredVariables(
37- const std::vector<std::string> & i_required_variables,
38- const boost::program_options::variables_map & i_key_file_var_map
37+ const std::vector<std::string>& i_required_variables,
38+ const boost::program_options::variables_map& i_key_file_var_map
3939 );
4040
4141 std::string MakeErrorMessage_VariableCannotGet(
42- const std::string & i_VarName
42+ const std::string& i_VarName
4343 );
4444
4545 std::string MakeErrorMessage_ThereIsNoVariable(
46- const std::string & i_VarName
46+ const std::string& i_VarName
4747 );
4848 }
--- trunk/src/CscdEncr/KeyFile.cpp (revision 16)
+++ trunk/src/CscdEncr/KeyFile.cpp (revision 17)
@@ -27,13 +27,13 @@
2727
2828 namespace VarName
2929 {
30- const char *const VERSION = "version";
31- const char *const ENCRYPTION_NAME = "encryption-name";
32- const char *const ENCRYPTION_KEY_HEX = "encryption-key-hex";
33- const char *const ENCRYPTION_IV_HEX = "encryption-iv-hex";
34- const char *const COMPRESS = "compress";
35- const char *const ADLER32 = "adler32";
36- const char *const PLAIN_FILE = "plain-file";
30+ const char*const VERSION = "version";
31+ const char*const ENCRYPTION_NAME = "encryption-name";
32+ const char*const ENCRYPTION_KEY_HEX = "encryption-key-hex";
33+ const char*const ENCRYPTION_IV_HEX = "encryption-iv-hex";
34+ const char*const COMPRESS = "compress";
35+ const char*const ADLER32 = "adler32";
36+ const char*const PLAIN_FILE = "plain-file";
3737 }
3838
3939 namespace VarValue
@@ -40,14 +40,14 @@
4040 {
4141 namespace COMPRESS
4242 {
43- const char *const DEFLATE = "deflate";
44- const char *const NONE = "none";
43+ const char*const DEFLATE = "deflate";
44+ const char*const NONE = "none";
4545 }
4646 }
4747
4848
4949 KeyFile::KeyFile(
50- const std::wstring & i_KeyFileName
50+ const std::wstring& i_KeyFileName
5151 )
5252 :
5353 m_AllEncryptionName(),
@@ -73,7 +73,7 @@
7373 // Read data from key file
7474 //
7575 void KeyFile::ReadDataFromKeyFile(
76- std::basic_istream<char> & i_ifs_key_file
76+ std::basic_istream<char>& i_ifs_key_file
7777 )
7878 {
7979 std::string version;
@@ -127,7 +127,7 @@
127127 key_file_var_map
128128 );
129129 }
130- catch(boost::program_options::error &e)
130+ catch(boost::program_options::error& e)
131131 {
132132 throw KeyFileException(e.what());
133133 }
@@ -154,7 +154,7 @@
154154 key_file_var_map
155155 );
156156 }
157- catch(FunctionsKeyFileException &e)
157+ catch(FunctionsKeyFileException& e)
158158 {
159159 throw KeyFileException(e.what());
160160 }
@@ -199,7 +199,7 @@
199199 m_AllEncryptionIVHex
200200 );
201201 }
202- catch(FunctionsKeyDataException &e)
202+ catch(FunctionsKeyDataException& e)
203203 {
204204 throw KeyFileException(e.what());
205205 }
@@ -223,14 +223,14 @@
223223 // Make output data for key file
224224 //
225225 void KeyFile::MakeOutputData(
226- const std::string & i_Version,
227- const std::vector<std::string> & i_AllEncryptionName,
228- const std::vector<CryptoPP::SecByteBlock> & i_AllEncryptionKey,
229- const std::vector<CryptoPP::SecByteBlock> & i_AllEncryptionIV,
226+ const std::string& i_Version,
227+ const std::vector<std::string>& i_AllEncryptionName,
228+ const std::vector<CryptoPP::SecByteBlock>& i_AllEncryptionKey,
229+ const std::vector<CryptoPP::SecByteBlock>& i_AllEncryptionIV,
230230 bool i_FlagCompress,
231- const std::string & i_Adler32OfPlainFile,
232- const std::wstring & i_PlainFileName,
233- std::stringstream & io_OutputData
231+ const std::string& i_Adler32OfPlainFile,
232+ const std::wstring& i_PlainFileName,
233+ std::stringstream& io_OutputData
234234 )
235235 {
236236 //----------
--- trunk/src/CscdEncr/SecondKeyFile.h (revision 16)
+++ trunk/src/CscdEncr/SecondKeyFile.h (revision 17)
@@ -17,11 +17,11 @@
1717
1818 #include "SecondKeyFileException.h"
1919
20-class SecondKeyFile : boost::noncopyable
20+class SecondKeyFile : private boost::noncopyable
2121 {
2222 public:
2323 explicit SecondKeyFile(
24- const std::wstring & i_SecondKeyFileName
24+ const std::wstring& i_SecondKeyFileName
2525 );
2626
2727 ~SecondKeyFile();
@@ -28,18 +28,18 @@
2828
2929 public:
3030 static void MakeOutputData(
31- const std::string & i_Version,
32- const std::vector<std::string> & i_AllAdditionEncryptionName,
33- const std::vector<CryptoPP::SecByteBlock> & i_AllAdditionEncryptionKey,
34- std::stringstream & io_OutputData
31+ const std::string& i_Version,
32+ const std::vector<std::string>& i_AllAdditionEncryptionName,
33+ const std::vector<CryptoPP::SecByteBlock>& i_AllAdditionEncryptionKey,
34+ std::stringstream& io_OutputData
3535 );
3636
3737 static std::string MakeErrorMessage_FileAlreadyExists(
38- const std::wstring & i_FileName
38+ const std::wstring& i_FileName
3939 );
4040
4141 public:
42- const std::map<std::string, std::string> & GetMap_Addition_EncryptionName_KeyHex() const
42+ const std::map<std::string, std::string>& GetMap_Addition_EncryptionName_KeyHex() const
4343 {
4444 return m_Map_Addition_EncryptionName_KeyHex;
4545 }
@@ -46,9 +46,9 @@
4646
4747 private:
4848 void MakeMapStringStringFromTwoVector(
49- const std::vector<std::string> & i_vectorStringKey,
50- const std::vector<std::string> & i_vectorStringValue,
51- std::map<std::string, std::string> & o_map_EncryptionName_KeyHex
49+ const std::vector<std::string>& i_vectorStringKey,
50+ const std::vector<std::string>& i_vectorStringValue,
51+ std::map<std::string, std::string>& o_map_EncryptionName_KeyHex
5252 );
5353
5454 private:
--- trunk/src/CscdEncr/AutoRemoveFilesWhenAbend.h (revision 16)
+++ trunk/src/CscdEncr/AutoRemoveFilesWhenAbend.h (revision 17)
@@ -15,7 +15,7 @@
1515 // along with this program. If not, see <http://www.gnu.org/licenses/>.
1616 //**********************************************************************
1717
18-class AutoRemoveFilesWhenAbend : boost::noncopyable
18+class AutoRemoveFilesWhenAbend : private boost::noncopyable
1919 {
2020 public:
2121 AutoRemoveFilesWhenAbend();
@@ -23,8 +23,8 @@
2323
2424 public:
2525 void OpenOutputFile(
26- const std::wstring & i_FileName,
27- std::ofstream & o_ofs
26+ const std::wstring& i_FileName,
27+ std::ofstream& o_ofs
2828 );
2929
3030 void NormalEnd();
--- trunk/src/CscdEncr/DecryptionInfo.cpp (revision 16)
+++ trunk/src/CscdEncr/DecryptionInfo.cpp (revision 17)
@@ -21,10 +21,10 @@
2121 #include "CommonLastInclude.h"
2222
2323 DecryptionInfo::DecryptionInfo(
24- const std::vector<std::string> & i_AllSpecifiedEncryptionName,
25- const std::vector<std::string> & i_AllEncryptionKeyHex,
26- const std::vector<std::string> & i_AllEncryptionIVHex,
27- const std::map<std::string, std::string> & i_map_EncryptionName_KeyHex
24+ const std::vector<std::string>& i_AllSpecifiedEncryptionName,
25+ const std::vector<std::string>& i_AllEncryptionKeyHex,
26+ const std::vector<std::string>& i_AllEncryptionIVHex,
27+ const std::map<std::string, std::string>& i_map_EncryptionName_KeyHex
2828 )
2929 :
3030 m_AllEncryptionHolder()
@@ -43,7 +43,7 @@
4343 // (unsigned)
4444 std::vector<std::string>::size_type counter_encription(number_encription - i - 1);
4545
46- const std::string & specified_encryption_name =
46+ const std::string& specified_encryption_name =
4747 i_AllSpecifiedEncryptionName.at(counter_encription)
4848 ;
4949
@@ -118,9 +118,9 @@
118118 //--------------------------------------------------
119119 // Get KeyHex from map_EncryptionName_KeyHex
120120 //
121-const std::string & DecryptionInfo::GetKeyHexFrom_map_EncryptionName_KeyHex(
122- const std::map<std::string, std::string> & i_map_EncryptionName_KeyHex,
123- const std::string & i_EncryptionName
121+const std::string& DecryptionInfo::GetKeyHexFrom_map_EncryptionName_KeyHex(
122+ const std::map<std::string, std::string>& i_map_EncryptionName_KeyHex,
123+ const std::string& i_EncryptionName
124124 ) const
125125 {
126126 std::map<std::string, std::string>::const_iterator pos;
--- trunk/src/CscdEncr/PresetEncryptionInfo.h (revision 16)
+++ trunk/src/CscdEncr/PresetEncryptionInfo.h (revision 17)
@@ -20,7 +20,7 @@
2020
2121 typedef boost::shared_ptr<CryptoPP::StreamTransformation> TSharedPointer_StreamTransformation;
2222
23-class PresetEncryptionInfo : boost::noncopyable
23+class PresetEncryptionInfo : private boost::noncopyable
2424 {
2525 public:
2626 PresetEncryptionInfo();
@@ -53,22 +53,22 @@
5353 };
5454
5555 public:
56- const PresetEncryptionInfoItem & GetEncryptionInfoItem(
57- const std::string & i_ItemName
56+ const PresetEncryptionInfoItem& GetEncryptionInfoItem(
57+ const std::string& i_ItemName
5858 ) const;
5959
6060 TSharedPointer_StreamTransformation GetEncryption(
6161 bool i_FlagEncrypt,
62- const std::string & i_AlgorithmName,
63- const std::string & i_ModeName,
64- const CryptoPP::SecByteBlock & i_Key,
65- const CryptoPP::SecByteBlock & i_IV
62+ const std::string& i_AlgorithmName,
63+ const std::string& i_ModeName,
64+ const CryptoPP::SecByteBlock& i_Key,
65+ const CryptoPP::SecByteBlock& i_IV
6666 ) const;
6767
6868 std::vector<std::string> GetAllItemName() const;
6969
7070 std::vector<std::string> GetAllItemNameByAlgorithmName(
71- const std::string & i_AlgorithmName
71+ const std::string& i_AlgorithmName
7272 ) const;
7373
7474 std::vector<std::string> GetAllAlgorithmName() const;
@@ -75,11 +75,11 @@
7575
7676 private:
7777 AlgorithmNumber GetAlgorithmNumber(
78- const std::string & i_AlgorithmName
78+ const std::string& i_AlgorithmName
7979 ) const;
8080
8181 ModeNumber GetModeNumber(
82- const std::string & i_ModeName
82+ const std::string& i_ModeName
8383 ) const;
8484
8585 template <typename i_TBlockCipher>
@@ -86,28 +86,28 @@
8686 void SetEncryptionInfoForBlockCipher(
8787 bool i_FlagEncrypt,
8888 ModeNumber i_ModeNumber,
89- const CryptoPP::SecByteBlock & i_Key,
90- const CryptoPP::SecByteBlock & i_IV,
91- TSharedPointer_StreamTransformation & io_EncryptionInfo
89+ const CryptoPP::SecByteBlock& i_Key,
90+ const CryptoPP::SecByteBlock& i_IV,
91+ TSharedPointer_StreamTransformation& io_EncryptionInfo
9292 ) const;
9393
9494 template <typename i_TStreamCipher>
9595 void SetEncryptionInfoForStreamCipher(
9696 bool i_FlagEncrypt,
97- const CryptoPP::SecByteBlock & i_Key,
98- const CryptoPP::SecByteBlock & i_IV,
99- TSharedPointer_StreamTransformation & io_EncryptionInfo
97+ const CryptoPP::SecByteBlock& i_Key,
98+ const CryptoPP::SecByteBlock& i_IV,
99+ TSharedPointer_StreamTransformation& io_EncryptionInfo
100100 ) const;
101101
102102 void InsertEncryptionInfo(
103- const std::string & i_AlgorithmName,
103+ const std::string& i_AlgorithmName,
104104 int i_KeyLength,
105- const std::string & i_ModeName,
105+ const std::string& i_ModeName,
106106 int i_IVLength
107107 );
108108
109109 void InsertEncryptionInfoForBlockCipher(
110- const std::string & i_AlgorithmName,
110+ const std::string& i_AlgorithmName,
111111 int i_KeyLength,
112112 int i_IVLength
113113 );
--- trunk/src/CscdEncr/FunctionsKeyDataException.h (revision 16)
+++ trunk/src/CscdEncr/FunctionsKeyDataException.h (revision 17)
@@ -20,7 +20,7 @@
2020 class FunctionsKeyDataException : public std::exception
2121 {
2222 public:
23- explicit FunctionsKeyDataException(const std::string & i_What)
23+ explicit FunctionsKeyDataException(const std::string& i_What)
2424 : std::exception(i_What.c_str())
2525 {
2626 }
@@ -30,8 +30,8 @@
3030 }
3131
3232 //(use default)
33- //FunctionsKeyDataException(const FunctionsKeyDataException &);
33+ //FunctionsKeyDataException(const FunctionsKeyDataException&);
3434
3535 //(use default)
36- //FunctionsKeyDataException & operator =( const FunctionsKeyDataException & );
36+ //FunctionsKeyDataException& operator =( const FunctionsKeyDataException&);
3737 };
旧リポジトリブラウザで表示