Alternate e697dbe9c5997e35395fe158628dd8c5209481da
for Visual Studio 2022 and Windows 11.
読み取り中…
検索中…
一致する文字列を見つけられません
alt::TString クラス

文字列に関するWindowsAPIを集約したクラス [詳解]

#include <TString.h>

alt::TString の継承関係図
alt::WindowsLibrary

公開メンバ関数

APIENTRY TString ()
 コンストラクタ
 
APIENTRY TString (const TString &string)
 コンストラクタ
 
APIENTRY TString (INT length)
 コンストラクタ
 
APIENTRY TString (LPCTSTR lpctszString)
 コンストラクタ
 
APIENTRY ~TString ()
 デストラクタ
 
INT APIENTRY Byte () const
 内部で確保している文字列(バイト数)を取得します。
 
LPCTSTR APIENTRY Ctr () const
 内部で確保している文字列ポインタを取得します。
 
int APIENTRY Find (TString keyword, int position=0)
 文字列を検索します。
 
TString &APIENTRY Format (LPCTSTR format,...)
 フォーマットに従ってパラメータを文字列化します。
 
BOOL APIENTRY FromMultiByte (LPCSTR lpcszSJIS, UINT codePage=CP_ACP)
 マルチバイト文字列を取り込みます。
 
INT APIENTRY Len () const
 内部で確保している文字列数を取得します。
 
BOOL APIENTRY operator!= (const TString &string) const
 TStringと文字列を比較します。
 
BOOL APIENTRY operator!= (LPCTSTR lpctszString) const
 文字列と比較します。
 
TString APIENTRY operator+ (LPCTSTR lpctszString)
 文字列を追加します。
 
TString APIENTRY operator+ (TString &string)
 文字列を追加します。
 
TString &APIENTRY operator+= (const TString &string)
 文字列を追加します。
 
TString &APIENTRY operator+= (LPCTSTR lpctszString)
 文字列を追加します。
 
bool APIENTRY operator< (const TString &string) const
 文字列の大小を比較します。
 
TString &APIENTRY operator<< (const int iValue)
 数値を代入します。
 
TString &APIENTRY operator<< (const TString &string)
 文字列を代入します。
 
TString &APIENTRY operator<< (LPCTSTR lpctszString)
 文字列を代入します。
 
VOID APIENTRY operator= (const TString &string)
 文字列を代入します。
 
VOID APIENTRY operator= (LPCTSTR lpctszString)
 文字列を代入します。
 
BOOL APIENTRY operator== (const TString &string) const
 TStringと文字列を比較します。
 
BOOL APIENTRY operator== (LPCTSTR lpctszString) const
 文字列と比較します。
 
TCHAR APIENTRY operator[] (int index) const
 文字列の一部を取り出します。
 
int APIENTRY ParseInt () const
 文字列の数値化
 
LPTSTR APIENTRY Ptr () const
 内部で確保している文字列ポインタを取得します。
 
TString APIENTRY Replace (TString &charsBefore, TString &charsAfter)
 文字列を置換します。
 
TString APIENTRY ReplaceAll (TString &charsBefore, TString &charsAfter)
 文字列を置換します。
 
skeleton::Array< TString > APIENTRY Split (const TString &delimiters)
 文字列を指定した文字列で分割します。
 
TString APIENTRY Substring (int startPos, int length=0)
 文字列を切り出します。
 
int APIENTRY ToSJIS (LPSTR lpszSJIS, DWORD dwLen)
 SJIS文字列を出力します。
 
TString &APIENTRY Trim ()
 左右の余白を切り取ります。
 
TString &APIENTRY TrimLeft ()
 左側の余白を切り取ります。
 
TString &APIENTRY TrimRight ()
 右側の余白を切り取ります。
 
- 基底クラス alt::WindowsLibrary に属する継承公開メンバ関数
APIENTRY WindowsLibrary ()
 コンストラクタ
 
virtual APIENTRY ~WindowsLibrary ()
 デストラクタ
 
virtual DWORD APIENTRY GetErrNo () const
 WindowsAPIのエラー値を取得します。
 
virtual VOID APIENTRY SetErrNo ()
 WINAPIエラーの情報を設定します。
 

限定公開メンバ関数

VOID APIENTRY Add (LPCTSTR lpctszString)
 
VOID APIENTRY Clear ()
 
int APIENTRY Compare (LPCTSTR lpctszString1, LPCTSTR lpctszString2, int size) const
 
VOID APIENTRY Copy (LPCTSTR lpctszString)
 
LPTSTR APIENTRY CreateMemory (ULONGLONG size)
 
INT APIENTRY Length (LPCTSTR lpctszString) const
 

限定公開変数類

LPTSTR _lptszString
 
- 基底クラス alt::WindowsLibrary に属する継承限定公開変数類
DWORD _dwErrorNo
 

詳解

文字列に関するWindowsAPIを集約したクラス

TString.h の 16 行目に定義があります。

構築子と解体子

◆ TString() [1/4]

TString::TString ( )

コンストラクタ

TString.cpp の 12 行目に定義があります。

参照先 _lptszString.

◆ TString() [2/4]

TString::TString ( LPCTSTR  lpctszString)

コンストラクタ

引数
[in]lpctszString生成時に格納する文字列

TString.cpp の 17 行目に定義があります。

参照先 Copy().

◆ TString() [3/4]

TString::TString ( const TString &  string)

コンストラクタ

引数
[in]string生成時に格納する文字列

TString.cpp の 23 行目に定義があります。

参照先 Copy(), Ptr().

◆ TString() [4/4]

TString::TString ( INT  length)

コンストラクタ

引数
[in]length生成時に確保するメモリサイズ(文字数)
覚え書き
APIなどで、TCHAR[256]が必要な場合に使用します。 Ptr()を使用すると、メモリ確保済みのポインタが 使用できます。

TString.cpp の 29 行目に定義があります。

参照先 _lptszString, CreateMemory().

◆ ~TString()

TString::~TString ( )

デストラクタ

TString.cpp の 34 行目に定義があります。

参照先 Clear().

関数詳解

◆ Add()

VOID TString::Add ( LPCTSTR  lpctszString)
protected

TString.cpp の 435 行目に定義があります。

参照先 _lptszString, Clear(), CreateMemory(), Len(), Length().

参照元 operator+=(), operator<<().

◆ Byte()

INT TString::Byte ( ) const

内部で確保している文字列(バイト数)を取得します。

戻り値
バイト長

TString.cpp の 44 行目に定義があります。

参照先 Len().

参照元 WindowsLibraryTest::TEST_CLASS().

◆ Clear()

VOID TString::Clear ( )
protected

TString.cpp の 405 行目に定義があります。

参照先 _lptszString.

参照元 ~TString(), Add(), Copy(), Format().

◆ Compare()

int TString::Compare ( LPCTSTR  lpctszString1,
LPCTSTR  lpctszString2,
int  size 
) const
protected

TString.cpp の 450 行目に定義があります。

参照先 size.

参照元 operator<(), operator==().

◆ Copy()

VOID TString::Copy ( LPCTSTR  lpctszString)
protected

TString.cpp の 418 行目に定義があります。

参照先 _lptszString, Clear(), CreateMemory(), Length().

参照元 TString(), operator=().

◆ CreateMemory()

LPTSTR TString::CreateMemory ( ULONGLONG  size)
protected

TString.cpp の 411 行目に定義があります。

参照先 size.

参照元 TString(), Add(), Copy(), Format().

◆ Ctr()

LPCTSTR APIENTRY alt::TString::Ctr ( ) const
inline

内部で確保している文字列ポインタを取得します。

戻り値
保持している文字列のポインタ

TString.h の 46 行目に定義があります。

参照元 alt::FactoryMethod::ClockElement::ClockElement(), alt::FactoryMethod::DummyProduct::DummyProduct(), alt::FactoryMethod::TerminateElement::TerminateElement(), _tmain(), alt::PerformanceDataItem::AddCounter(), alt::Log::AppendLog(), alt::Utility::Base64Decode(), PerfCheck::TStringPerformanceCheck::Core2(), alt::FactoryMethod::Creator::CreateElement(), alt::Log::CreateLog(), alt::FactoryMethod::Creator::CreateProduct(), DrivePipelineFactory(), DriveTcpClient(), DriveTcpProxy(), DriveTcpServer(), DriveUdpController1(), DriveUdpController2(), alt::FactoryMethod::DummyProduct::Exit(), alt::FileUtility::Find(), alt::FileUtility::Find2(), alt::Log::FindHistory(), alt::MiddleLibrary::GetProfileStr(), alt::MiddleLibrary::GetProfileValue(), alt::FactoryMethod::DummyProduct::Init(), alt::FactoryMethod::ClockElement::Invoke(), alt::FactoryMethod::Config::Load(), alt::Log::OpenLog(), operator<(), operator==(), alt::FactoryMethod::DummyProduct::Process(), alt::FactoryMethod::Config::Reload(), ReplaceAll(), alt::Log::RotateLogFile(), alt::FactoryMethod::DummyProduct::Start(), alt::FactoryMethod::DummyProduct::Stop(), WindowsLibraryTest::TEST_CLASS(), MiddleLibraryTest::TEST_CLASS(), alt::FactoryMethod::TerminateElement::Update(), alt::FactoryMethod::DummyProduct::Update(), alt::FactoryMethod::ProductManager::Update(), alt::Utility::WriteIniFile() (計41項目).

◆ Find()

int TString::Find ( TString  keyword,
int  position = 0 
)

文字列を検索します。

引数
[in]keyword検索する文字列
[in]position検索開始位置
戻り値
検索した文字列の開始位置

TString.cpp の 296 行目に定義があります。

参照先 _lptszString, Len(), Ptr().

参照元 Replace(), ReplaceAll().

◆ Format()

TString & TString::Format ( LPCTSTR  format,
  ... 
)

◆ FromMultiByte()

BOOL TString::FromMultiByte ( LPCSTR  lpcszSJIS,
UINT  codePage = CP_ACP 
)

マルチバイト文字列を取り込みます。

引数
[in]lpcszSJISヌルターミネートされた文字列
[in]codePageマルチバイトの文字コード
戻り値
BOOL 変換に成功か否か
戻り値
true成功
false失敗
覚え書き
SJIS -> CP_ACP (既定値) UTF-8 -> CP_UTF8

TString.cpp の 350 行目に定義があります。

参照先 Ptr().

参照元 WindowsLibraryTest::TEST_CLASS().

◆ Len()

INT TString::Len ( ) const

内部で確保している文字列数を取得します。

戻り値
文字列長

TString.cpp の 39 行目に定義があります。

参照先 _lptszString, Length().

参照元 Add(), alt::Utility::Base64Decode(), Byte(), Find(), operator<(), operator==(), operator[](), ParseInt(), Replace(), ReplaceAll(), Split(), Substring(), WindowsLibraryTest::TEST_CLASS(), TrimLeft(), TrimRight() (計15項目).

◆ Length()

INT TString::Length ( LPCTSTR  lpctszString) const
protected

TString.cpp の 469 行目に定義があります。

参照元 Add(), Copy(), Len(), operator<(), operator==().

◆ operator!=() [1/2]

BOOL TString::operator!= ( const TString &  string) const

TStringと文字列を比較します。

引数
[in]string比較するTStringオブジェクト
戻り値
一致しないか否か
戻り値
TRUE一致する
FALSE一致しない

TString.cpp の 73 行目に定義があります。

参照先 operator==().

◆ operator!=() [2/2]

BOOL TString::operator!= ( LPCTSTR  lpctszString) const

文字列と比較します。

戻り値
一致しないか否か
戻り値
TRUE一致する
FALSE一致しない

TString.cpp の 68 行目に定義があります。

参照先 operator==().

◆ operator+() [1/2]

TString TString::operator+ ( LPCTSTR  lpctszString)

文字列を追加します。

引数
[in]lpctszString文字列
戻り値
追加された文字列の結果

TString.cpp の 112 行目に定義があります。

参照先 _lptszString.

◆ operator+() [2/2]

TString TString::operator+ ( TString &  string)

文字列を追加します。

引数
[in]string文字列
戻り値
追加された文字列の結果

TString.cpp の 120 行目に定義があります。

参照先 _lptszString.

◆ operator+=() [1/2]

TString & TString::operator+= ( const TString &  string)

文字列を追加します。

引数
[in]string文字列
戻り値
代入された自分自身

TString.cpp の 135 行目に定義があります。

参照先 Add(), Ptr().

◆ operator+=() [2/2]

TString & TString::operator+= ( LPCTSTR  lpctszString)

文字列を追加します。

引数
[in]lpctszString文字列
戻り値
代入された自分自身

TString.cpp の 128 行目に定義があります。

参照先 Add().

◆ operator<()

bool TString::operator< ( const TString &  string) const

文字列の大小を比較します。

引数
[in]string比較対象
戻り値
比較結果
戻り値
true比較する側が小さい
false比較する側が大きい

TString.cpp の 142 行目に定義があります。

参照先 _lptszString, Compare(), Ctr(), Len(), Length(), size.

◆ operator<<() [1/3]

TString & TString::operator<< ( const int  iValue)

数値を代入します。

引数
[in]iValue数値
戻り値
代入された自分自身

TString.cpp の 102 行目に定義があります。

参照先 Add().

◆ operator<<() [2/3]

TString & TString::operator<< ( const TString &  string)

文字列を代入します。

引数
[in]string文字列
戻り値
代入された自分自身

TString.cpp の 95 行目に定義があります。

参照先 Add(), Ptr().

◆ operator<<() [3/3]

TString & TString::operator<< ( LPCTSTR  lpctszString)

文字列を代入します。

引数
[in]lpctszString文字列
戻り値
代入された自分自身

TString.cpp の 88 行目に定義があります。

参照先 Add().

◆ operator=() [1/2]

VOID TString::operator= ( const TString &  string)

文字列を代入します。

引数
[in]string文字列

TString.cpp の 83 行目に定義があります。

参照先 Copy(), Ptr().

◆ operator=() [2/2]

VOID TString::operator= ( LPCTSTR  lpctszString)

文字列を代入します。

引数
[in]lpctszString文字列

TString.cpp の 78 行目に定義があります。

参照先 Copy().

◆ operator==() [1/2]

BOOL TString::operator== ( const TString &  string) const

TStringと文字列を比較します。

引数
[in]string比較するTStringオブジェクト
戻り値
一致するか否か
戻り値
TRUE一致する
FALSE一致しない

TString.cpp の 60 行目に定義があります。

参照先 _lptszString, Compare(), Ctr(), Len(), Length(), size.

◆ operator==() [2/2]

BOOL TString::operator== ( LPCTSTR  lpctszString) const

文字列と比較します。

戻り値
一致するか否か
戻り値
TRUE一致する
FALSE一致しない

TString.cpp の 49 行目に定義があります。

参照先 _lptszString, Compare(), Length(), size.

参照元 operator!=().

◆ operator[]()

TCHAR TString::operator[] ( int  index) const

文字列の一部を取り出します。

引数
[in]index場所の指定
戻り値
指定された場所にある文字

TString.cpp の 149 行目に定義があります。

参照先 _lptszString, Len().

◆ ParseInt()

int TString::ParseInt ( ) const

文字列の数値化

戻り値
数値(INT)

TString.cpp の 370 行目に定義があります。

参照先 _lptszString, Len().

参照元 WindowsLibraryTest::TEST_CLASS().

◆ Ptr()

◆ Replace()

TString TString::Replace ( TString &  charsBefore,
TString &  charsAfter 
)

文字列を置換します。

引数
[in]charsBefore検索する文字列
[in]charsAfter置換する文字列
戻り値
検索結果を置換した文字列

TString.cpp の 233 行目に定義があります。

参照先 Find(), Len(), Substring().

参照元 LeakCheck::TStringMemoryLeakCheck::DoAction4(), WindowsLibraryTest::TEST_CLASS().

◆ ReplaceAll()

TString TString::ReplaceAll ( TString &  charsBefore,
TString &  charsAfter 
)

文字列を置換します。

引数
[in]charsBefore検索する文字列
[in]charsAfter置換する文字列
戻り値
検索結果をすべて置換した文字列

TString.cpp の 246 行目に定義があります。

参照先 Ctr(), Find(), Len(), Substring().

参照元 LeakCheck::TStringMemoryLeakCheck::DoAction4(), WindowsLibraryTest::TEST_CLASS().

◆ Split()

skeleton::Array< TString > TString::Split ( const TString &  delimiters)

文字列を指定した文字列で分割します。

引数
[in]delimiters分割する文字の集合
戻り値
delimiters単位で分割した文字列群
覚え書き
delimiterに入っている文字はすべて分割対象です。

TString.cpp の 267 行目に定義があります。

参照先 _lptszString, alt::skeleton::Array< T >::Add(), Len(), Ptr().

参照元 PerfCheck::TStringPerformanceCheck::Core1().

◆ Substring()

TString TString::Substring ( int  startPos,
int  length = 0 
)

文字列を切り出します。

引数
[in]startPos切り出し開始位置
[in]length切り出しサイズ
戻り値
切り出した文字列

TString.cpp の 219 行目に定義があります。

参照先 _lptszString, Len(), Ptr().

参照元 alt::FactoryMethod::Creator::CreateProduct(), Replace(), ReplaceAll(), WindowsLibraryTest::TEST_CLASS().

◆ ToSJIS()

int TString::ToSJIS ( LPSTR  lpszSJIS,
DWORD  dwLen 
)

SJIS文字列を出力します。

引数
[out]lpszSJISSJIS文字列
[in]dwLenSJIS文字列を格納するバッファサイズ
戻り値
書き込んだバイト数

TString.cpp の 364 行目に定義があります。

参照先 _lptszString.

参照元 WindowsLibraryTest::TEST_CLASS().

◆ Trim()

TString & TString::Trim ( )

左右の余白を切り取ります。

戻り値
左右の余白を切り取った自分自身

TString.cpp の 211 行目に定義があります。

参照先 TrimLeft(), TrimRight().

◆ TrimLeft()

TString & TString::TrimLeft ( )

左側の余白を切り取ります。

戻り値
左側余白を切り取った自分自身

TString.cpp の 165 行目に定義があります。

参照先 _lptszString, Len().

参照元 Trim().

◆ TrimRight()

TString & TString::TrimRight ( )

右側の余白を切り取ります。

戻り値
右側余白を切り取った自分自身

TString.cpp の 189 行目に定義があります。

参照先 _lptszString, Len().

参照元 Trim().

メンバ詳解

◆ _lptszString

LPTSTR alt::TString::_lptszString
protected

このクラス詳解は次のファイルから抽出されました: