📄 csharedata_new.cpp
字号:
printsetting.m_mdmDevMode.m_szPrinterDriverName,
sizeof( m_pShareData->m_PrintSettingArr[0].m_mdmDevMode.m_szPrinterDriverName ));
wsprintf( szKeyName, "PS[%02d].szDevice", i );
cProfile.IOProfileData( bRead, pszSecName, szKeyName,
printsetting.m_mdmDevMode.m_szPrinterDeviceName,
sizeof( m_pShareData->m_PrintSettingArr[0].m_mdmDevMode.m_szPrinterDeviceName ));
wsprintf( szKeyName, "PS[%02d].szOutput", i );
cProfile.IOProfileData( bRead, pszSecName, szKeyName,
printsetting.m_mdmDevMode.m_szPrinterOutputName,
sizeof( printsetting.m_mdmDevMode.m_szPrinterOutputName ));
// 2002.02.16 hor とりあえず旧設定を変換しとく
if(0==strcmp(printsetting.m_szHeaderForm[0],"&f") &&
0==strcmp(printsetting.m_szFooterForm[0],"&C- &P -")
){
strcpy( printsetting.m_szHeaderForm[0], "$f" );
strcpy( printsetting.m_szFooterForm[0], "" );
strcpy( printsetting.m_szFooterForm[1], "- $p -" );
}
//禁則 //@@@ 2002.04.09 MIK
wsprintf( szKeyName, "PS[%02d].bKinsokuHead", i ); cProfile.IOProfileData( bRead, pszSecName, szKeyName, printsetting.m_bPrintKinsokuHead );
wsprintf( szKeyName, "PS[%02d].bKinsokuTail", i ); cProfile.IOProfileData( bRead, pszSecName, szKeyName, printsetting.m_bPrintKinsokuTail );
wsprintf( szKeyName, "PS[%02d].bKinsokuRet", i ); cProfile.IOProfileData( bRead, pszSecName, szKeyName, printsetting.m_bPrintKinsokuRet ); //@@@ 2002.04.13 MIK
wsprintf( szKeyName, "PS[%02d].bKinsokuKuto", i ); cProfile.IOProfileData( bRead, pszSecName, szKeyName, printsetting.m_bPrintKinsokuKuto ); //@@@ 2002.04.17 MIK
}
}
/*!
@brief 共有データのTypesセクションの入出力
@param[in] bRead true: 読み込み / false: 書き込み
@param[in,out] cProfile INIファイル入出力クラス
@date 2005-04-07 D.S.Koba ShareData_IO_2から分離。
*/
void CShareData::ShareData_IO_Types( const bool bRead, CProfile& cProfile )
{
const char* pszSecName;
int i, j;
char szKey[256];
char szKeyName[64];
char szKeyData[1024];
for( i = 0; i < MAX_TYPES; ++i ){
// 2005.04.07 D.S.Koba
Types& types = m_pShareData->m_Types[i];
wsprintf( szKey, "Types(%d)", i );
pszSecName = szKey;
static const char* pszForm = "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d"; //MIK
strcpy( szKeyName, "nInts" );
if( bRead ){
if( true == cProfile.IOProfileData( bRead, pszSecName, szKeyName, szKeyData, sizeof( szKeyData )) ){
sscanf( szKeyData, pszForm,
&types.m_nIdx,
&types.m_nMaxLineSize,
&types.m_nColmSpace,
&types.m_nTabSpace,
&types.m_nKeyWordSetIdx[0],
&types.m_nKeyWordSetIdx[1], //MIK
&types.m_nStringType,
&types.m_bLineNumIsCRLF,
&types.m_nLineTermType,
&types.m_bWordWrap,
&types.m_nCurrentPrintSetting
);
}
}else{
wsprintf( szKeyData, pszForm,
types.m_nIdx,
types.m_nMaxLineSize,
types.m_nColmSpace,
types.m_nTabSpace,
types.m_nKeyWordSetIdx[0],
types.m_nKeyWordSetIdx[1], //MIK
types.m_nStringType,
types.m_bLineNumIsCRLF,
types.m_nLineTermType,
types.m_bWordWrap,
types.m_nCurrentPrintSetting
);
cProfile.IOProfileData( bRead, pszSecName, szKeyName, szKeyData, 0 );
}
// 2005.01.13 MIK Keywordset 3-10
cProfile.IOProfileData( bRead, pszSecName, "nKeywordSelect3", types.m_nKeyWordSetIdx[2] );
cProfile.IOProfileData( bRead, pszSecName, "nKeywordSelect4", types.m_nKeyWordSetIdx[3] );
cProfile.IOProfileData( bRead, pszSecName, "nKeywordSelect5", types.m_nKeyWordSetIdx[4] );
cProfile.IOProfileData( bRead, pszSecName, "nKeywordSelect6", types.m_nKeyWordSetIdx[5] );
cProfile.IOProfileData( bRead, pszSecName, "nKeywordSelect7", types.m_nKeyWordSetIdx[6] );
cProfile.IOProfileData( bRead, pszSecName, "nKeywordSelect8", types.m_nKeyWordSetIdx[7] );
cProfile.IOProfileData( bRead, pszSecName, "nKeywordSelect9", types.m_nKeyWordSetIdx[8] );
cProfile.IOProfileData( bRead, pszSecName, "nKeywordSelect10", types.m_nKeyWordSetIdx[9] );
/* 行間のすきま */
if( !bRead ){
if( types.m_nLineSpace < /* 1 */ 0 ){
types.m_nLineSpace = /* 1 */ 0;
}
if( types.m_nLineSpace > LINESPACE_MAX ){ // Feb. 18, 2003 genta 最大値の定数化
types.m_nLineSpace = LINESPACE_MAX;
}
}
cProfile.IOProfileData( bRead, pszSecName, "nLineSpace", types.m_nLineSpace );
if( bRead ){
if( types.m_nLineSpace < /* 1 */ 0 ){
types.m_nLineSpace = /* 1 */ 0;
}
if( types.m_nLineSpace > 16 ){
types.m_nLineSpace = 16;
}
}
cProfile.IOProfileData( bRead, pszSecName, "szTypeName",
types.m_szTypeName,
sizeof( m_pShareData->m_Types[0].m_szTypeName ));
cProfile.IOProfileData( bRead, pszSecName, "szTypeExts",
types.m_szTypeExts,
sizeof( m_pShareData->m_Types[0].m_szTypeExts ));
//#ifdef COMPILE_TAB_VIEW //@@@ 2001.03.16 by MIK
cProfile.IOProfileData( bRead, pszSecName, "szTabViewString",
/*&*/types.m_szTabViewString,
sizeof( types.m_szTabViewString ));
//#endif
cProfile.IOProfileData( bRead, pszSecName, "bTabArrow" , types.m_bTabArrow ); //@@@ 2003.03.26 MIK
cProfile.IOProfileData( bRead, pszSecName, "bInsSpace" , types.m_bInsSpace ); // 2001.12.03 hor
// From Here Sep. 28, 2002 genta / YAZAKI
if( bRead ){
// Block Comment
char buffer[2][ BLOCKCOMMENT_BUFFERSIZE ];
// 2004.10.02 Moca 対になるコメント設定がともに読み込まれたときだけ有効な設定と見なす.
// ブロックコメントの始まりと終わり.行コメントの記号と桁位置
bool bRet1, bRet2;
buffer[0][0] = buffer[1][0] = '\0';
bRet1 = cProfile.IOProfileData( bRead, pszSecName, "szBlockCommentFrom" ,
buffer[0], BLOCKCOMMENT_BUFFERSIZE );
bRet2 = cProfile.IOProfileData( bRead, pszSecName, "szBlockCommentTo" ,
buffer[1], BLOCKCOMMENT_BUFFERSIZE );
if( bRet1 && bRet2 ) types.m_cBlockComment.CopyTo( 0, buffer[0], buffer[1] );
//@@@ 2001.03.10 by MIK
buffer[0][0] = buffer[1][0] = '\0';
bRet1 = cProfile.IOProfileData( bRead, pszSecName, "szBlockCommentFrom2",
buffer[0], BLOCKCOMMENT_BUFFERSIZE );
bRet2 = cProfile.IOProfileData( bRead, pszSecName, "szBlockCommentTo2" ,
buffer[1], BLOCKCOMMENT_BUFFERSIZE );
if( bRet1 && bRet2 ) types.m_cBlockComment.CopyTo( 1, buffer[0], buffer[1] );
// Line Comment
char lbuf[ COMMENT_DELIMITER_BUFFERSIZE ];
int pos;
lbuf[0] = '\0'; pos = -1;
bRet1 = cProfile.IOProfileData( bRead, pszSecName, "szLineComment" ,
lbuf, COMMENT_DELIMITER_BUFFERSIZE );
bRet2 = cProfile.IOProfileData( bRead, pszSecName, "nLineCommentColumn" , pos );
if( bRet1 && bRet2 ) types.m_cLineComment.CopyTo( 0, lbuf, pos );
lbuf[0] = '\0'; pos = -1;
bRet1 = cProfile.IOProfileData( bRead, pszSecName, "szLineComment2" ,
lbuf, COMMENT_DELIMITER_BUFFERSIZE );
bRet2 = cProfile.IOProfileData( bRead, pszSecName, "nLineCommentColumn2", pos );
if( bRet1 && bRet2 ) types.m_cLineComment.CopyTo( 1, lbuf, pos );
lbuf[0] = '\0'; pos = -1;
bRet1 = cProfile.IOProfileData( bRead, pszSecName, "szLineComment3" ,
lbuf, COMMENT_DELIMITER_BUFFERSIZE ); //Jun. 01, 2001 JEPRO 追加
bRet2 = cProfile.IOProfileData( bRead, pszSecName, "nLineCommentColumn3", pos ); //Jun. 01, 2001 JEPRO 追加
if( bRet1 && bRet2 ) types.m_cLineComment.CopyTo( 2, lbuf, pos );
}
else { // write
// Block Comment
cProfile.IOProfileData( bRead, pszSecName, "szBlockCommentFrom" ,
const_cast<char*>(types.m_cBlockComment.getBlockCommentFrom( 0 )), 0 );
cProfile.IOProfileData( bRead, pszSecName, "szBlockCommentTo" ,
const_cast<char*>(types.m_cBlockComment.getBlockCommentTo( 0 )), 0 );
//@@@ 2001.03.10 by MIK
cProfile.IOProfileData( bRead, pszSecName, "szBlockCommentFrom2",
const_cast<char*>(types.m_cBlockComment.getBlockCommentFrom( 1 )), 0 );
cProfile.IOProfileData( bRead, pszSecName, "szBlockCommentTo2" ,
const_cast<char*>(types.m_cBlockComment.getBlockCommentTo(1)), 0 );
// Line Comment
cProfile.IOProfileData( bRead, pszSecName, "szLineComment" ,
const_cast<char*>(types.m_cLineComment.getLineComment( 0 )), 0 );
cProfile.IOProfileData( bRead, pszSecName, "szLineComment2" ,
const_cast<char*>(types.m_cLineComment.getLineComment( 1 )), 0 );
cProfile.IOProfileData( bRead, pszSecName, "szLineComment3" ,
const_cast<char*>(types.m_cLineComment.getLineComment( 2 )), 0 ); //Jun. 01, 2001 JEPRO 追加
// From here May 12, 2001 genta
int pos;
pos = types.m_cLineComment.getLineCommentPos( 0 );
cProfile.IOProfileData( bRead, pszSecName, "nLineCommentColumn" , pos );
pos = types.m_cLineComment.getLineCommentPos( 1 );
cProfile.IOProfileData( bRead, pszSecName, "nLineCommentColumn2", pos );
pos = types.m_cLineComment.getLineCommentPos( 2 );
cProfile.IOProfileData( bRead, pszSecName, "nLineCommentColumn3", pos ); //Jun. 01, 2001 JEPRO 追加
// To here May 12, 2001 genta
}
// To Here Sep. 28, 2002 genta / YAZAKI
cProfile.IOProfileData( bRead, pszSecName, "szIndentChars" ,
types.m_szIndentChars,
sizeof( m_pShareData->m_Types[0].m_szIndentChars ));
cProfile.IOProfileData( bRead, pszSecName, "cLineTermChar" , types.m_cLineTermChar );
cProfile.IOProfileData( bRead, pszSecName, "nDefaultOutline" , types.m_nDefaultOutline );/* アウトライン解析方法 */
cProfile.IOProfileData( bRead, pszSecName, "szOutlineRuleFilename" ,
types.m_szOutlineRuleFilename,
sizeof( m_pShareData->m_Types[0].m_szOutlineRuleFilename ));/* アウトライン解析ルールファイル */
cProfile.IOProfileData( bRead, pszSecName, "nSmartIndent" , types.m_nSmartIndent );/* スマートインデント種別 */
// Nov. 20, 2000 genta
cProfile.IOProfileData( bRead, pszSecName, "nImeState" , types.m_nImeState ); // IME制御
// 2001/06/14 Start By asa-o: タイプ別の補完ファイルとキーワードヘルプ
// Oct. 5, 2002 genta sizeof()で誤ってポインタのサイズを取得していたのを修正
cProfile.IOProfileData( bRead, pszSecName, "szHokanFile" ,
types.m_szHokanFile,
sizeof( m_pShareData->m_Types[0].m_szHokanFile )); // 補完ファイル
cProfile.IOProfileData( bRead, pszSecName, "bUseKeyWordHelp" , types.m_bUseKeyWordHelp ); // キーワードヘルプを使用する
cProfile.IOProfileData( bRead, pszSecName, "szKeyWordHelpFile" ,
types.m_szKeyWordHelpFile,
sizeof( m_pShareData->m_Types[0].m_szKeyWordHelpFile )); // キーワードヘルプ 辞書ファイル
// 2001/06/14 End
// 2001/06/19 asa-o
cProfile.IOProfileData( bRead, pszSecName, "bHokanLoHiCase" , types.m_bHokanLoHiCase );
// 2003.06.23 Moca ファイル内からの入力補完機能
cProfile.IOProfileData( bRead, pszSecName, "bUseHokanByFile" , types.m_bUseHokanByFile );
//@@@ 2002.2.4 YAZAKI
cProfile.IOProfileData( bRead, pszSecName, "szExtHelp" ,
types.m_szExtHelp,
sizeof( m_pShareData->m_Types[0].m_szExtHelp ));
cProfile.IOProfileData( bRead, pszSecName, "szExtHtmlHelp" ,
types.m_szExtHtmlHelp,
sizeof( types.m_szExtHtmlHelp ));
cProfile.IOProfileData( bRead, pszSecName, "bHtmlHelpIsSingle" , types.m_bHokanLoHiCase );
cProfile.IOProfileData( bRead, pszSecName, "bAutoIndent" , types.m_bAutoIndent );
cProfile.IOProfileData( bRead, pszSecName, "bAutoIndent_ZENSPACE" , types.m_bAutoIndent_ZENSPACE );
cProfile.IOProfileData( bRead, pszSecName, "nIndentLayout" , types.m_nIndentLayout );
/* 色設定 I/O */
IO_ColorSet( &cProfile, bRead, pszSecName, types.m_ColorInfoArr );
//@@@ 2001.11.17 add start MIK
{ //正規表現キーワード
char *p;
cProfile.IOProfileData( bRead, pszSecName, "bUseRegexKeyword", types.m_bUseRegexKeyword );/* 正規表現キーワード使用するか? */
for(j = 0; j < 100; j++)
{
wsprintf( szKeyName, "RxKey[%03d]", j );
if( bRead )
{
types.m_RegexKeywordArr[j].m_szKeyword[0] = '\0';
types.m_RegexKeywordArr[j].m_nColorIndex = COLORIDX_REGEX1;
if( true == cProfile.IOProfileData( bRead, pszSecName, szKeyName, szKeyData, sizeof( szKeyData )) )
{
p = strchr(szKeyData, ',');
if( p )
{
*p = '\0';
types.m_RegexKeywordArr[j].m_nColorIndex = GetColorIndexByName(szKeyData); //@@@ 2002.04.30
if( types.m_RegexKeywordArr[j].m_nColorIndex == -1 ) //名前でない
types.m_RegexKeywordArr[j].m_nColorIndex = atoi(szKeyData);
p++;
strcpy(types.m_RegexKeywordArr[j].m_szKeyword, p);
if( types.m_RegexKeywordArr[j].m_nColorIndex < 0
|| types.m_RegexKeywordArr[j].m_nColorIndex >= COLORIDX_LAST )
{
types.m_RegexKeywordArr[j].m_nColorIndex = COLORIDX_REGEX1;
}
}
}
}
else
// 2002.02.08 hor 未定義値を無視
if(lstrlen(types.m_RegexKeywordArr[j].m_szKeyword))
{
//wsprintf( szKeyData, "%d,%s",
// types.m_RegexKeywordArr[j].m_nColorIndex,
// types.m_RegexKeywordArr[j].m_szKeyword);
wsprintf( szKeyData, "%s,%s",
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -