wex v24.04.0
Public Types | Public Member Functions | List of all members
wex::factory::sort Class Reference

Offers a sort class to sort text blocks, from strings or stc component. More...

#include <wex/factory/sort.h>

Public Types

enum  { SORT_DESCENDING = 0 , SORT_UNIQUE = 1 }
 The sort flags. More...
 
typedef std::bitset< 2 > sort_t
 A typedef containing sort flags.
 

Public Member Functions

 sort (sort_t t=sort_t(), size_t pos=0, size_t len=std::string::npos)
 Default constructor.
 
bool selection (factory::stc *stc)
 Sorts selected text on specified component, returns true if sorted ok.
 
const std::string string (const std::string &input, const std::string &separators)
 Sorts specified input, returns string with sorted text.
 

Detailed Description

Offers a sort class to sort text blocks, from strings or stc component.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

The sort flags.

Enumerator
SORT_DESCENDING 

sort descending order

SORT_UNIQUE 

flag to remove doubles

Constructor & Destructor Documentation

◆ sort()

wex::factory::sort::sort ( sort_t t = sort_t(),
size_t pos = 0,
size_t len = std::string::npos )

Default constructor.

Parameters
tsort type
posposition of the first character to be sorted
lennumber of characters to sort string::npos indicates all characters until eol

Member Function Documentation

◆ string()

const std::string wex::factory::sort::string ( const std::string & input,
const std::string & separators )

Sorts specified input, returns string with sorted text.

Parameters
inputtext to sort
separatorscharacters to split lines