|
Guitar
|
Classes | |
| class | str |
| class | strlist |
Functions | |
| static int | stricmp (char const *s1, char const *s2) |
| static int | strnicmp (char const *s1, char const *s2, size_t n) |
| static int | stricmp (std::string_view const &s1, std::string_view const &s2) |
| static char const * | stristr (const char *haystack, const char *needle) |
| std::vector< std::string_view > | splitLinesV (std::string_view const &str) |
| std::vector< std::string_view > | splitLinesV (std::vector< char > const &ba) |
| std::vector< std::string_view > | splitLinesKeepNewLineV (std::string_view const &str) |
| std::vector< std::string > | splitLines (std::string_view const &str) |
| std::vector< std::string_view > | splitWords (std::string_view const &text) |
| 文字列を単語に分割する More... | |
| std::vector< std::string_view > | split (std::string_view const &sv, char sep) |
| std::string | filename (std::string const &path) |
| bool | starts_with (const std::string_view &str, const std::string_view &with) |
| 文字列が指定の文字列で始まるか判定する More... | |
| bool | starts_with (const std::string_view &str, char with) |
| bool | ends_with (const std::string_view &str, const std::string_view &with) |
| 文字列が指定の文字列で終わるか判定する More... | |
| bool | ends_with (const std::string_view &str, char with) |
| std::string | mid (std::string const &str, int start, int length=-1) |
| 文字列の一部分を取得する More... | |
| std::string | replace_backslash_to_slash (std::string_view const &in) |
| バックスラッシュをスラッシュに置換する More... | |
| std::string | normalizePathSeparator (std::string const &str) |
| パスの区切り文字を正規化する More... | |
| void | dump (const uint8_t *ptr, size_t len) |
| メモリダンプを16進数で表示する More... | |
| bool | isText (std::string const &mimetype) |
| バイナリデータの内容をヘキサでダンプする More... | |
| bool | isImage (std::string const &mimetype) |
| MIMEタイプが画像ファイルを表すか判定する More... | |
| bool | isSVG (std::string const &mimetype) |
| MIMEタイプがSVG画像を表すか判定する More... | |
| bool | isPSD (std::string const &mimetype) |
| MIMEタイプがPhotoshopファイルを表すか判定する More... | |
| bool | isPDF (std::string const &mimetype) |
| MIMEタイプがPDFファイルを表すか判定する More... | |
| std::string | makeProxyServerURL (std::string text) |
| プロキシサーバーURLを正規化する More... | |
| bool | isExecutable (const std::string &cmd) |
| ファイルが実行可能か判定する More... | |
| bool | isValidMailAddress (std::string const &email) |
| std::string_view | trimmed (std::string_view const &s) |
| 文字列の両端から空白文字を取り除く More... | |
| std::string_view | trimQuotes (std::string_view s) |
| 文字列の両端から空白文字と引用符を取り除く More... | |
| std::string_view | trimNewLines (std::string_view s) |
| 文字列の両端から改行文字を取り除く More... | |
| std::string | bin_to_hex_string (const void *begin, const void *end) |
| バイナリデータを16進数文字列に変換する More... | |
| std::vector< uint8_t > | hex_string_to_bin (std::string_view const &s, const char *sep=nullptr) |
| 16進数文字列をバイナリデータに変換する More... | |
| int | compare (uint8_t const *a, size_t n, uint8_t const *b, size_t m) |
| 2つのバイナリデータを比較する More... | |
| int | compare (std::vector< uint8_t > const &a, std::vector< uint8_t > const &b) |
| 2つのバイトベクターを比較する More... | |
| std::string | toLower (std::string_view const &s) |
| std::string | toUpper (std::string_view const &s) |
| static std::vector< std::string > | vector_string (std::vector< std::string_view > const &v) |
| template<typename T > | |
| static T | toi (std::string_view const &s, size_t *consumed=nullptr) |
| static void | append (std::vector< char > *out, char const *ptr, size_t len) |
| static void | append (std::vector< char > *out, char c) |
| static void | append (std::vector< char > *out, std::string_view const &v) |
| std::string | strip_vt (std::string_view const &s) |
| VTシーケンスを取り除く More... | |
| std::string | getProgram (std::string const &cmdline) |
| std::string | realpath (const char *path) |
| パスを絶対パスに変換する More... | |
| std::string | realpath (std::string const &path) |
| static QString | escape_double_quote_for_file_open (QString const &in) |
| QStringList | splitWords (QString const &text) |
| 文字列を単語に分割する。 More... | |
| QString | getApplicationDir () |
| アプリケーションのディレクトリパスを取得する More... | |
| void | drawFrame (QPainter *pr, int x, int y, int w, int h, QColor color_topleft, QColor color_bottomright=QColor()) |
| 矩形のフレームを描画する。 More... | |
| QString | makeDateTimeString (const QDateTime &dt) |
| 日時を文字列に変換する More... | |
| void | setFixedSize (QWidget *w) |
| ウィジェットのサイズを固定する More... | |
| QPoint | contextMenuPos (QWidget *w, QContextMenuEvent *e) |
| コンテキストメニューを表示する位置を計算する More... | |
| QString | abbrevBranchName (QString const &name) |
| ブランチ名を短縮形に変換する。 More... | |
| QString | makeProxyServerURL (QString text) |
| プロキシサーバーURLを正規化する More... | |
| QString | collapseWhitespace (QString const &source) |
| 文字列内の連続する空白文字を1つのスペースにまとめる。 More... | |
| std::wstring | convert_str_to_wstr (std::string const &str) |
| std::string | convert_wstr_to_str (std::wstring const &str) |
| void | parse_args (std::string const &cmd, std::vector< std::string > *out) |
| QString misc::abbrevBranchName | ( | QString const & | name | ) |
ブランチ名を短縮形に変換する。
入力されたブランチ名を短縮形に変換します。ブランチ名の各パス要素の先頭文字を抽出し、 最後のパス要素を除いて短縮形にします。
| name | 短縮形に変換する対象のブランチ名。 |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |

| std::string misc::bin_to_hex_string | ( | const void * | begin, |
| const void * | end | ||
| ) |
バイナリデータを16進数文字列に変換する
バイナリデータ(バイト列)を16進数表記の文字列に変換します。 各バイトは2桁の16進数で表現されます(00-FF)。
| begin | 変換するバイナリデータの先頭ポインタ |
| end | 変換するバイナリデータの終端ポインタ(変換対象に含まれない) |
| QString misc::collapseWhitespace | ( | QString const & | source | ) |
文字列内の連続する空白文字を1つのスペースにまとめる。
入力された文字列内の連続する空白文字を1つのスペースにまとめ、結果の文字列を返します。
| source | 連続する空白文字をまとめる対象のQStringオブジェクト。 |
| int misc::compare | ( | std::vector< uint8_t > const & | a, |
| std::vector< uint8_t > const & | b | ||
| ) |
2つのバイトベクターを比較する
2つのバイトベクターを辞書的に比較します。 内部的にはcompare関数を使用して、ベクターの内容と長さを比較します。
| a | 比較する最初のバイトベクター |
| b | 比較する2番目のバイトベクター |

| int misc::compare | ( | uint8_t const * | a, |
| size_t | n, | ||
| uint8_t const * | b, | ||
| size_t | m | ||
| ) |
2つのバイナリデータを比較する
2つのバイト配列を辞書的に比較します。最初に異なるバイトが見つかった時点で その大小関係を返します。同じバイト列で長さが異なる場合は、長い方が大きいと判定されます。
| a | 比較する最初のバイト配列 |
| n | 最初の配列の長さ |
| b | 比較する2番目のバイト配列 |
| m | 2番目の配列の長さ |
| QPoint misc::contextMenuPos | ( | QWidget * | w, |
| QContextMenuEvent * | e | ||
| ) |
コンテキストメニューを表示する位置を計算する
コンテキストメニューイベントに基づいて、メニューを表示する適切な位置を計算します。 マウスによる右クリックの場合はカーソルの位置にオフセット(8,-8)を加え、 それ以外の場合(キーボードでの表示等)はウィジェットの左上から少し離れた位置(4,4)を返します。
| w | コンテキストメニューを表示するウィジェット |
| e | コンテキストメニューイベント |
| std::wstring misc::convert_str_to_wstr | ( | std::string const & | str | ) |

| std::string misc::convert_wstr_to_str | ( | std::wstring const & | str | ) |

| void misc::drawFrame | ( | QPainter * | pr, |
| int | x, | ||
| int | y, | ||
| int | w, | ||
| int | h, | ||
| QColor | color_topleft, | ||
| QColor | color_bottomright = QColor() |
||
| ) |
矩形のフレームを描画する。
指定された位置とサイズの矩形のフレームを描画します。フレームの上辺と左辺は、 color_topleftで指定された色で描画され、右辺と下辺はcolor_bottomrightで指定された色で描画されます。
| pr | フレームを描画する対象のQPainterオブジェクトへのポインタ。 |
| x | 矩形の左上隅のX座標。 |
| y | 矩形の左上隅のY座標。 |
| w | 矩形の幅。 |
| h | 矩形の高さ。 |
| color_topleft | フレームの上辺と左辺の色。 |
| color_bottomright | フレームの右辺と下辺の色。 |
| void misc::dump | ( | const uint8_t * | ptr, |
| size_t | len | ||
| ) |
メモリダンプを16進数で表示する
与えられたメモリ領域を16進数でダンプし、表示します。ダンプは、 アドレス、16進数データ(最大16バイトずつ)、ASCII文字列表現の3つの列で構成されます。 表示されない制御文字はピリオド(.)で表示されます。
| ptr | ダンプするメモリ領域の先頭ポインタ、nullptrの場合は何も表示しません |
| len | ダンプするメモリ領域の長さ(バイト数) |
| bool misc::ends_with | ( | const std::string_view & | str, |
| char | with | ||
| ) |

| bool misc::ends_with | ( | const std::string_view & | str, |
| const std::string_view & | with | ||
| ) |
文字列が指定の文字列で終わるか判定する
与えられた文字列が、指定された文字列で終わるかどうかを判定します。
| str | チェックする対象の文字列 |
| with | 終端に存在するか確認する文字列 |
|
inlinestatic |
| std::string misc::filename | ( | std::string const & | path | ) |
| QString misc::getApplicationDir | ( | ) |
アプリケーションのディレクトリパスを取得する
実行可能ファイルが格納されているディレクトリのパスを返します。 Windowsの場合は'\'、Unixの場合は'/'をパス区切り文字として扱います。
| std::string misc::getProgram | ( | std::string const & | cmdline | ) |
コマンドラインから実行ファイル名を抜き取る。 例: "C:\Program Files\MyApp\app.exe" –option -> C:\Program Files\MyApp\app.exe
| std::vector< uint8_t > misc::hex_string_to_bin | ( | std::string_view const & | s, |
| const char * | sep = nullptr |
||
| ) |
16進数文字列をバイナリデータに変換する
16進数表記の文字列をバイナリデータ(バイト列)に変換します。 文字列には2桁の16進数表記(00-FF)を含める必要があります。 オプションで区切り文字を指定することもできます。
| s | 変換する16進数文字列 |
| sep | 区切り文字の文字列。区切り文字はスキップされる。nullptrの場合は区切り文字なし |
| bool misc::isExecutable | ( | const std::string & | cmd | ) |
ファイルが実行可能か判定する
指定されたファイルパスが実行可能なファイルを指しているか判定します。
| cmd | 判定するファイルパス |

| bool misc::isImage | ( | std::string const & | mimetype | ) |
MIMEタイプが画像ファイルを表すか判定する
与えられたMIMEタイプが画像ファイルを表すか判定します。 PDFファイルや「image/」で始まる全てのMIMEタイプを画像として扱います。
| mimetype | 判定するMIMEタイプ文字列 |

| bool misc::isPDF | ( | std::string const & | mimetype | ) |
MIMEタイプがPDFファイルを表すか判定する
与えられたMIMEタイプがPDFファイルを表すか判定します。
| mimetype | 判定するMIMEタイプ文字列 |
| bool misc::isPSD | ( | std::string const & | mimetype | ) |
MIMEタイプがPhotoshopファイルを表すか判定する
与えられたMIMEタイプがAdobe Photoshopのファイルを表すか判定します。
| mimetype | 判定するMIMEタイプ文字列 |
| bool misc::isSVG | ( | std::string const & | mimetype | ) |
MIMEタイプがSVG画像を表すか判定する
与えられたMIMEタイプがSVG画像ファイルを表すか判定します。
| mimetype | 判定するMIMEタイプ文字列 |
| bool misc::isText | ( | std::string const & | mimetype | ) |
バイナリデータの内容をヘキサでダンプする
QByteArrayの内容をヘキサダンプ形式で表示します。 内部的にはdump(uint8_t const *, size_t)関数を使用して、 QByteArrayの内容をバイト配列としてダンプします。
| in | ダンプするQByteArrayへのポインタ、nullptrの場合は何も表示しません |
MIMEタイプがテキストファイルを表すか判定する
与えられたMIMEタイプがテキストファイルを表すか判定します。
| mimetype | 判定するMIMEタイプ文字列 |

| bool misc::isValidMailAddress | ( | std::string const & | ) |

| QString misc::makeDateTimeString | ( | const QDateTime & | dt | ) |
日時を文字列に変換する
日時情報を読みやすい文字列形式に変換します。 デフォルトではISOフォーマットを使用し、'T'を空白に置換します。
| dt | 変換する日時情報 |
| QString misc::makeProxyServerURL | ( | QString | text | ) |
プロキシサーバーURLを正規化する
入力されたプロキシサーバーのURLを正規化します。 プロトコルが指定されていない場合は "http://" を付加し、 末尾にスラッシュがない場合は付加します。
| text | 正規化するプロキシサーバーURL文字列 |
| std::string misc::makeProxyServerURL | ( | std::string | text | ) |
プロキシサーバーURLを正規化する
入力されたプロキシサーバーのURLを正規化します。 プロトコルが指定されていない場合は "http://" を付加し、 末尾にスラッシュがない場合は付加します。
| text | 正規化するプロキシサーバーURL文字列 |
| std::string misc::mid | ( | std::string const & | str, |
| int | start, | ||
| int | length = -1 |
||
| ) |
文字列の一部分を取得する
与えられた文字列の指定位置から、指定された長さの部分文字列を抽出します。
| str | 対象の文字列 |
| start | 抽出を開始する位置のインデックス |
| length | 抽出する文字の数。負の場合は文字列の最後まで抽出する |
| std::string misc::normalizePathSeparator | ( | std::string const & | str | ) |
パスの区切り文字を正規化する
パスの区切り文字をプラットフォームに合わせて正規化します。 Windowsでは '/' を '\' に変換し、 Unix系プラットフォームでは変換を行いません。
| str | 正規化するパス文字列 |
| void misc::parse_args | ( | std::string const & | cmd, |
| std::vector< std::string > * | out | ||
| ) |
| std::string misc::realpath | ( | const char * | path | ) |
パスを絶対パスに変換する
指定されたパスを絶対パスに変換して返します。パスが存在しない場合や、変換に失敗した場合は空文字列を返します。 '~'で始まるパスは、環境変数HOMEの値を展開して変換します。
| path | 変換するパス |

| std::string misc::realpath | ( | std::string const & | path | ) |

| std::string misc::replace_backslash_to_slash | ( | std::string_view const & | in | ) |
バックスラッシュをスラッシュに置換する
与えられた文字列内の全てのバックスラッシュ ('\') をスラッシュ ('/') に置換します。 置換された新しい文字列が返されます。
| in | 置換する対象の文字列 |
| void misc::setFixedSize | ( | QWidget * | w | ) |
ウィジェットのサイズを固定する
ウィジェットのサイズを固定し、リサイズできないようにします。 また、コンテキストヘルプボタンを非表示にし、Windowsの固定サイズダイアログヒントを設定します。
| w | サイズを固定する対象のウィジェット |
| std::vector< std::string_view > misc::split | ( | std::string_view const & | sv, |
| char | sep | ||
| ) |
| std::vector< std::string > misc::splitLines | ( | std::string_view const & | str | ) |
| std::vector< std::string_view > misc::splitLinesKeepNewLineV | ( | std::string_view const & | str | ) |
| std::vector< std::string_view > misc::splitLinesV | ( | std::string_view const & | str | ) |
| std::vector< std::string_view > misc::splitLinesV | ( | std::vector< char > const & | ba | ) |
| QStringList misc::splitWords | ( | QString const & | text | ) |
文字列を単語に分割する。
与えられた文字列を単語に分割し、QStringListとして返します。分割は、空白文字を 区切りとして行われます。
| text | 分割する対象の文字列。 |
| std::vector< std::string_view > misc::splitWords | ( | std::string_view const & | text | ) |
文字列を単語に分割する
与えられた文字列を単語に分割し、std::string_viewのベクターとして返します。 分割は、空白文字を区切りとして行われます。
| text | 分割する対象の文字列 |
| bool misc::starts_with | ( | const std::string_view & | str, |
| char | with | ||
| ) |

| bool misc::starts_with | ( | const std::string_view & | str, |
| const std::string_view & | with | ||
| ) |
文字列が指定の文字列で始まるか判定する
与えられた文字列が、指定された文字列で始まるかどうかを判定します。
| str | チェックする対象の文字列 |
| with | 先頭に存在するか確認する文字列 |
|
inlinestatic |

|
inlinestatic |

| std::string misc::strip_vt | ( | std::string_view const & | s | ) |
VTシーケンスを取り除く
文字列からVT(バーチャルターミナル)シーケンスを取り除き、通常のテキストのみを抽出します。 VTシーケンスはエスケープ文字(0x1b)で始まり、特定のパターンに従います。 この関数は、エスケープシーケンスを正しく認識し、それらをスキップしてテキスト部分だけを返します。
| s | VTシーケンスを含む可能性のある入力文字列 |
|
inlinestatic |

|
inlinestatic |
|
inlinestatic |
| std::string misc::toLower | ( | std::string_view const & | s | ) |
| std::string misc::toUpper | ( | std::string_view const & | s | ) |
| std::string_view misc::trimmed | ( | std::string_view const & | s | ) |
文字列の両端から空白文字を取り除く
文字列の先頭と末尾から空白文字(スペース、タブ、改行など)を削除します。 元の文字列は変更せず、新しいstring_viewを返します。
| s | トリムする文字列 |
| std::string_view misc::trimNewLines | ( | std::string_view | s | ) |
文字列の両端から改行文字を取り除く
文字列の先頭と末尾から改行文字(CR、LF、CRLF)を削除します。 元の文字列は変更せず、新しいstring_viewを返します。 CR+LFの組み合わせは1つの改行として扱われます。
| s | トリムする文字列 |
| std::string_view misc::trimQuotes | ( | std::string_view | s | ) |
文字列の両端から空白文字と引用符を取り除く
文字列の先頭と末尾から空白文字を削除し、その後引用符('"'または'\'')で囲まれている場合は それらの引用符も削除します。元の文字列は変更せず、新しいstring_viewを返します。
| s | トリムする文字列 |

|
inlinestatic |