関数filename_pattern_includeComponent マニュアル

(The documentation of function filename_pattern_includeComponent)

Last Update: 2025/2/25


◆機能・用途(Purpose)

文字列が成分コードをパターンとして含むか否かを判定する。
Identify whether a string consists of a pattern for component code.


◆形式(Format)

#include <mystring.h>
inline _Bool filename_pattern_includeComponent
(const char ∗string_with_pattern)


◆引数(Arguments)

string_with_pattern ファイル名を表す文字列。以下をパターンとして含んでいて良い。
A string that represents a file name, which may consist of the following patterns.

  • %YYYY
    年(西暦、4桁)
    Year (A.D., 4-digits)

  • %YY
    年(西暦、下2桁)
    Year (A.D., lowest 2-digits)

  • %MM
    月(2桁)
    Month (2-digits)

  • %DD
    日(2桁)
    Day (2-digits)

  • %JJJ
    その年の先頭からの日数(3桁、1月1日が001)
    The number of days from the beginning of the year (3-digits; Jan. 1 corresponds to 001)

  • %hh
    時(2桁)
    Hour (2-digits)

  • %mm
    分(2桁)
    Minute (2-digits)

  • %ss
    秒(2桁)
    Second (2-digits)

  • %STATION
    観測点コード
    Station code

  • %COMPONENT
    成分コード
    Component code



◆戻り値(Return value)

引数string_with_patternで与えた文字列に 「%COMPONENT」が含まれていればtrue、含まれていなければfalse。
The return value is true if the string given by argument string_with_pattern consists of “%COMPONENT”, false otherwise.


◆使用例(Example)

char inputfiles[strsize];
struct humanTime dateTime;
char ∗inputfile;
if(filename_pattern_includeComponent(inputfiles)){
    inputfile=determine_filename_from_pattern (inputfiles,dateTime,"STN1","U");
}