[#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&hyphen;style component source and test driver names&period;

== Synopsis

Declared in `&lt;bsls&lowbar;bslsourcenameparserutil&period;h&gt;`

[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&lowbar;p` parameter of `getComponentName`&period;
|===


== 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`&period; The behavior is undefined unless `errorCode &lt; 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&period;
| xref:BloombergLP/bsls/BslSourceNameParserUtil/getComponentName.adoc[`getComponentName`] 
| Parse the specified Lakos&hyphen;style `sourceName` source file name with optional path portion to find the component name part&period; Return zero on success and a non&hyphen;zero value if parsing failed&period; 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&period; Optionally specify `type&lowbar;p`&period; When `type&lowbar;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&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
