Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CNativeW クラスの SetString メソッドに std::wstring_view 型を受け取るものを追加 #1734

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sakura_core/CGrepAgent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ DWORD CGrepAgent::DoGrep(
// 解析済みのファイルパターン配列を取得する
const auto& vecSearchFileKeys = cGrepEnumKeys.m_vecSearchFileKeys;
std::wstring strPatterns = FormatPathList( vecSearchFileKeys );
cmemWork.SetString( strPatterns.c_str(), strPatterns.length() );
cmemWork.SetString( strPatterns );
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion sakura_core/CHokanMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ int CHokanMgr::Search(
if( 1 == m_vKouho.size() ){
if(pcmemHokanWord != NULL){
m_nCurKouhoIdx = -1;
pcmemHokanWord->SetString( m_vKouho[0].c_str() );
pcmemHokanWord->SetString( m_vKouho[0] );
return 1;
}
}
Expand Down
6 changes: 3 additions & 3 deletions sakura_core/cmd/CViewCommander_Grep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void CViewCommander::Command_GREP( void )
CNativeW cmWork2;
CNativeW cmWork3;
CNativeW cmWork4;
cmWork1.SetString( GetEditWindow()->m_cDlgGrep.m_strText.c_str() );
cmWork1.SetString( GetEditWindow()->m_cDlgGrep.m_strText );
cmWork2 = GetEditWindow()->m_cDlgGrep.GetPackedGFileString();
cmWork3.SetString( GetEditWindow()->m_cDlgGrep.m_szFolder );

Expand Down Expand Up @@ -167,10 +167,10 @@ void CViewCommander::Command_GREP_REPLACE( void )
CNativeW cmWork4;

CDlgGrepReplace& cDlgGrepRep = GetEditWindow()->m_cDlgGrepReplace;
cmWork1.SetString( cDlgGrepRep.m_strText.c_str() );
cmWork1.SetString( cDlgGrepRep.m_strText );
cmWork2 = cDlgGrepRep.GetPackedGFileString();
cmWork3.SetString( cDlgGrepRep.m_szFolder );
cmWork4.SetString( cDlgGrepRep.m_strText2.c_str() );
cmWork4.SetString( cDlgGrepRep.m_strText2 );

/* 今のEditViewにGrep結果を表示する。
Grepモードのとき、または未編集で無題かつアウトプットでない場合。
Expand Down
2 changes: 1 addition & 1 deletion sakura_core/cmd/CViewCommander_Search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ void CViewCommander::Command_REPLACE_ALL()
else
{
// 2004.05.14 Moca 全置換の途中で他のウィンドウで置換されるとまずいのでコピーする
cmemClip.SetString( GetEditWindow()->m_cDlgReplace.m_strText2.c_str() );
cmemClip.SetString( GetEditWindow()->m_cDlgReplace.m_strText2 );
}

CLogicInt nREPLACEKEY = cmemClip.GetStringLength();
Expand Down
2 changes: 1 addition & 1 deletion sakura_core/convert/CConvert_TabToSpace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ bool CConvert_TabToSpace::DoConvert(CNativeW* pcData)
}
if (buffer.empty())
return false;
pcData->SetString(buffer.c_str(), buffer.length());
pcData->SetString(buffer);
return true;
}
1 change: 1 addition & 0 deletions sakura_core/mem/CNativeW.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class CNativeW final : public CNative{
//WCHAR
void SetString( const wchar_t* pData, size_t nDataLen ); //!< バッファの内容を置き換える。nDataLenは文字単位。
void SetString( const wchar_t* pszData ); //!< バッファの内容を置き換える。
void SetString( const std::wstring& str ) { SetString(str.c_str(), str.length()); }
berryzplus marked this conversation as resolved.
Show resolved Hide resolved
void SetStringHoldBuffer( const wchar_t* pData, size_t nDataLen );
void AppendString( const wchar_t* pszData, size_t nDataLen ); //!< バッファの最後にデータを追加する。nLengthは文字単位。成功すればtrue。メモリ確保に失敗したらfalseを返す。
void AppendString( std::wstring_view data ); //!< バッファの最後にデータを追加する
Expand Down