[#BloombergLP-bsls-BslSourceNameParserUtil] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsls.adoc[bsls]::BslSourceNameParserUtil :relfileprefix: ../../ :mrdocs: This `struct` provides a namespace for `static` utility functions that parse source file names (as may be reported by the `*FILE*` macro), including Lakos‐style component source and test driver names. == Synopsis Declared in `<bsls_bslsourcenameparserutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- struct BslSourceNameParserUtil; ---- == Enums [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bsls/BslSourceNameParserUtil/SourceTypes.adoc[`SourceTypes`] | Bit masks and constants describing the meaning of the `type_p` parameter of `getComponentName`. |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bsls/BslSourceNameParserUtil/errorMessage.adoc[`errorMessage`] | Return a static, brief English error message that describes the specified negative parsing `errorCode`. The behavior is undefined unless `errorCode < 0` and was returned by one of the parsing methods (of this utility) that states in its contract to use this method to get the description of an error code. | xref:BloombergLP/bsls/BslSourceNameParserUtil/getComponentName.adoc[`getComponentName`] | Parse the specified Lakos‐style `sourceName` source file name with optional path portion to find the component name part. Return zero on success and a non‐zero value if parsing failed. In case of success, fill the specified `componentNamePtr` with a pointer to the first character, and the specified `componentNameLength` with the number of character of the component name found. Optionally specify `type_p`. When `type_p` is not 0 set the bits of the pointed `unsigned`, according to `SourceTypes`, that describe the type of the source file that was parsed. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#