DocWire SDK
DocWire SDK: Award-winning modern data processing in C++20. SourceForge Community Choice & Microsoft support. AI-driven processing. Supports nearly 100 data formats, including email boxes and OCR. Boost efficiency in text extraction, web data extraction, data mining, document analysis. Offline processing possible for security and confidentiality
docwire::file_extension Class Reference

A class representing a file extension. More...

#include <file_extension.h>

Public Member Functions

 file_extension (const std::string &ext)
 Constructs a file_extension object from a string. More...
 
 file_extension (const std::filesystem::path &p)
 Constructs a file_extension object from a path. More...
 
 file_extension (const char *ext)
 Constructs a file_extension object from a const literal. More...
 
std::string string () const
 Returns the file extension as a string. More...
 
bool operator== (const file_extension &other) const
 Compares two file extensions for equality, ignoring case. More...
 
std::strong_ordering operator<=> (const file_extension &other) const
 Compares two file extensions for equality, ignoring case. More...
 

Detailed Description

A class representing a file extension.

File extensions are case-insensitive.

Definition at line 27 of file file_extension.h.

Constructor & Destructor Documentation

◆ file_extension() [1/3]

docwire::file_extension::file_extension ( const std::string &  ext)
inlineexplicit

Constructs a file_extension object from a string.

The string is converted to lowercase.

Parameters
extThe extension string.

Definition at line 37 of file file_extension.h.

◆ file_extension() [2/3]

docwire::file_extension::file_extension ( const std::filesystem::path &  p)
inlineexplicit

Constructs a file_extension object from a path.

The extension is extracted from the path and converted to lowercase.

Parameters
pThe path.

Definition at line 49 of file file_extension.h.

◆ file_extension() [3/3]

docwire::file_extension::file_extension ( const char *  ext)
inlineexplicit

Constructs a file_extension object from a const literal.

The literal is converted to lowercase.

Parameters
extThe extension literal.

Definition at line 61 of file file_extension.h.

Member Function Documentation

◆ operator<=>()

std::strong_ordering docwire::file_extension::operator<=> ( const file_extension other) const
inline

Compares two file extensions for equality, ignoring case.

Parameters
otherThe file extension to compare with.
Returns
A comparison result indicating whether the file extensions are equal, less than, or greater than each other.

Definition at line 96 of file file_extension.h.

◆ operator==()

bool docwire::file_extension::operator== ( const file_extension other) const
inline

Compares two file extensions for equality, ignoring case.

Parameters
otherThe file extension to compare with.
Returns
True if the file extensions are equal, ignoring case; otherwise, false.

Definition at line 84 of file file_extension.h.

◆ string()

std::string docwire::file_extension::string ( ) const
inline

Returns the file extension as a string.

Returns
The file extension.

Definition at line 72 of file file_extension.h.


The documentation for this class was generated from the following file: