Software and Services, Portable Libraries  2019.Mar.01
A library for managing digital certificates
SoftwareAndServices::Library::Common::CStringCompareOperator Class Reference

Compares c-string (char*). More...

#include </home/doug/src/SoftwareAndServices/libSaSCommon/StringCompareOperator.hpp>

Public Member Functions

bool operator() (const char *One, const char *Two) const
 C-String compare operator. More...
 

Detailed Description

Compares c-string (char*).

Used as a method/class for std searching. (_Object->find(...)).

Simple Example:

* std::map<const char *, const char *, CStringCompareOperator> var;
*
* std::map<const char *, const char *, CStringCompareOperator>::iterator it;
* var.insert(std::make_pair("Key1", "Value1");
* var.insert(std::make_pair("Key2", "Value2");
*
* it = std::find(var.begin(), var.end(), "Key1");
* if (it != var.end()) {
*   // FOUND!
* }
*
* std::map<const String *, const String *, StringCompareOperator> var2;
*
* std::map<const String *, const String *, StringCompareOperator>::iterator it2;
*
* String        Key1 = "Key1";
* String        Key2 = "Key2":
*
* String        Value1 = "Value1";
* String        Value2 = "Value2";

* var.insert(std::make_pair(&Key1, &Value1);
* var.insert(std::make_pair(&Key2, &Value2);
*
* it2 = std::find(var2.begin(), var2.end(), &Key1);
* if (it2 != var2.end()) {
*   // FOUND!
* }
*
* 

Definition at line 114 of file StringCompareOperator.hpp.

Member Function Documentation

◆ operator()()

bool SoftwareAndServices::Library::Common::CStringCompareOperator::operator() ( const char *  One,
const char *  Two 
) const

C-String compare operator.

Parameters
OneThe first string to compare.
TwoThe second string to compare.
Returns
true if One < Two.

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