• R/O
  • SSH
  • HTTPS

cadencii: コミット


コミットメタ情報

リビジョン1931 (tree)
日時2012-01-09 17:32:45
作者kbinani

ログメッセージ

[vConnect/trunk/stand2.0] modified: stand.h; PATH_SEPARATORを削除

変更サマリ

差分

--- vConnect/trunk/stand2.0/stand/stand.cpp (revision 1930)
+++ vConnect/trunk/stand2.0/stand/stand.cpp (revision 1931)
@@ -18,18 +18,3 @@
1818 mutex_t hMutex = NULL;
1919 mutex_t hFFTWMutex = NULL;
2020 #endif
21-
22-/**
23- * str中の文字列searchをreplaceに置換する
24- */
25-void string_replace( string_t& str, string_t search, string_t replace )
26-{
27- int indx = str.find( search, 0 );
28- int slen = search.length();
29- int rlen = replace.length();
30- while( indx != string_t::npos )
31- {
32- str.replace( indx, slen, replace );
33- indx = str.find( search, indx - slen + rlen + 1 );
34- }
35-}
--- vConnect/trunk/stand2.0/stand/vConnectConverter.h (revision 1930)
+++ vConnect/trunk/stand2.0/stand/vConnectConverter.h (revision 1931)
@@ -28,15 +28,15 @@
2828 * @param dstDir 出力先ディレクトリ名.
2929 * @returns 分析に成功した場合true,それ以外はfalseを返します.
3030 */
31- bool convert( const char *otoIni, const char *dstDir )
31+ bool convert( const char *otoIni, const char *directory )
3232 {
33- string srcDir = otoIni;
34- string dstDir_s = dstDir;
35- srcDir = srcDir.substr( 0, srcDir.rfind( PATH_SEPARATOR ) );
33+ string sourceDirectory = Path::getDirectoryName( otoIni );
34+ string destinationDirectory = directory;
3635 int count = 0;
3736
3837 TextInputStream reader( otoIni, "Shift_JIS" );
39- TextOutputStream writer( (dstDir_s + "oto.ini").c_str(), "Shift_JIS", "\x0D\x0A" );
38+ string destinationOtoIni = Path::combine( destinationDirectory, "oto.ini" );
39+ TextOutputStream writer( destinationOtoIni, "Shift_JIS", "\x0D\x0A" );
4040 while( reader.ready() ){
4141 string buffer = reader.readLine();
4242 if( buffer.length() == 0 ){
@@ -44,7 +44,7 @@
4444 }
4545 count++;
4646
47- string line = this->processRecord( buffer, count, srcDir, dstDir_s );
47+ string line = this->processRecord( buffer, count, sourceDirectory, destinationDirectory );
4848
4949 if( line.length() > 0 ){
5050 writer.writeLine( line );
@@ -91,8 +91,9 @@
9191 cerr << "Begin analysis : " << alias << " @ " << fileName << endl;
9292
9393 waveFileEx waveFile;
94- if( waveFile.readWaveFile( sourceDirectory + PATH_SEPARATOR + fileName ) != 1 ){
95- cout << "error ; can't open the file, " << (sourceDirectory + PATH_SEPARATOR + fileName).c_str() << endl;
94+ string waveFilePath = Path::combine( sourceDirectory, fileName );
95+ if( waveFile.readWaveFile( waveFilePath ) != 1 ){
96+ cout << "error ; can't open the file, " << waveFilePath << endl;
9697 return "";
9798 }
9899 int waveLength = waveFile.getWaveLength( leftBlank, rightBlank );
@@ -125,11 +126,11 @@
125126 phoneme.computeWave( wave, waveLength, 44100, 2.0 );
126127 cerr << " Done. Elapsed time = " << (clock() - cl) << "[ms]" << endl;
127128
128- fileName = destinationDirectory + vvdName;
129- if( phoneme.writePhoneme( fileName.c_str() ) ){
130- cerr << "Wrote file : " << fileName << endl;
129+ string vvdFilePath = Path::combine( destinationDirectory, vvdName );
130+ if( phoneme.writePhoneme( vvdFilePath.c_str() ) ){
131+ cerr << "Wrote file : " << vvdFilePath << endl;
131132 }else{
132- cerr << "Error. Failed to write : " << fileName << endl;
133+ cerr << "Error. Failed to write : " << vvdFilePath << endl;
133134 }
134135 cerr << "====" << endl;
135136
--- vConnect/trunk/stand2.0/stand/stand.h (revision 1930)
+++ vConnect/trunk/stand2.0/stand/stand.h (revision 1931)
@@ -184,18 +184,6 @@
184184 #endif
185185 #endif
186186
187-// パスの区切り文字を決める
188-const string_t PATH_SEPARATOR_SLANT = _T("/");
189-const string_t PATH_SEPARATOR_BACKSLASH = _T("\\");
190-const int NUM_PSUDE_PATH_SEPARATOR = 2;
191-// ウォン記号と円記号.円記号の方はバックスラッシュの代替としての円記号ではなく,Unicodeのマジな円記号なので書き換えるとき注意
192-static string_t PSUDE_PATH_SEPARATOR[NUM_PSUDE_PATH_SEPARATOR] = { _T("¥"), _T("₩") };
193-#ifdef STND_OS_WIN
194-const string_t PATH_SEPARATOR = PATH_SEPARATOR_BACKSLASH;
195-#else
196-const string_t PATH_SEPARATOR = PATH_SEPARATOR_SLANT;
197-#endif
198-
199187 #define LINEBUFF_LEN 4096
200188
201189 /* マルチスレッド実装の種類 動かせる?
旧リポジトリブラウザで表示