TProcura
Biblioteca em C++ para testes paramétricos de algoritmos, e coleção de algoritmos de procura e otimização
Loading...
Searching...
No Matches
TString Class Reference

#include <TVector.h>

Inheritance diagram for TString:
Collaboration diagram for TString:

Public Member Functions

 TString ()
 
 TString (const char *s)
 
 TString (int v)
 
 operator const char * () const noexcept
 
const char * operator* () const noexcept
 
TStringprintf (const char *fmt,...)
 
TStringoperator+= (const TString &other)
 
bool Empty () const
 
unsigned int Hash () const
 
TVector< TStringtok (const char *delim=" \t\n\r") const
 
TVector< TStringreadLines ()
 
TStringwriteLines (const TVector< TString > &lines, bool append=false)
 
- Public Member Functions inherited from TVector< char >
TVectoroperator+= (const TVector &o)
 Concatena outro vetor a este.
 
TVectoroperator+= (std::initializer_list< char > init)
 Adiciona múltiplos elementos ao final do vetor.
 
TVector< char > & operator+= (const char *str)=delete
 Acrescenta elementos a partir de uma string no formato de lista.
 
 TVector (int size=0)
 Construtor.
 
 TVector (int size, char const *init)
 Constrói um vetor pré-carregado a partir de um array.
 
virtual ~TVector () noexcept
 Destrutor.
 
 TVector (const TVector &o)
 Construtor de cópia.
 
 TVector (TVector &&o) noexcept
 Construtor de movimentação.
 
 TVector (std::initializer_list< char > init)
 Constrói um vetor a partir de uma lista de inicialização.
 
 TVector (const char *str)
 Constrói um vetor de inteiros a partir de uma string no formato de lista.
 
TVectoroperator= (const TVector &o)
 Operador de atribuição por cópia.
 
TVectoroperator= (TVector &&o) noexcept
 Operador de atribuição por movimentação.
 
TVector< char > & Add (char a)
 
TVector< char > & Insert (TVector< char > &v, int index=0)
 Insere um vetor de itens na posição indicada.
 
TVector< char > & Insert (char a, int index=0)
 Insere um único elemento na posição indicada.
 
TVector< char > & Push (char a)
 
char & Pop ()
 
char & operator[] (int i)
 Acesso por índice com auto-expansão.
 
const char & operator[] (int i) const
 Acesso constante por índice sem modificação de tamanho.
 
char * Data ()
 Acesso direto.
 
const char * Data () const
 Acesso direto constante.
 
char & First ()
 
char & Last ()
 
int Count () const
 
TVector< char > & Count (int value)
 Ajusta o tamanho lógico do vetor para value.
 
char & Random ()
 
TVector< char > & BeASet ()
 Converte o vetor num conjunto: remove duplicados e ordena.
 
TVector< char > & Union (const TVector< char > &v)
 Realiza a união deste conjunto com outro.
 
TVector< char > & Intersection (const TVector< char > &v)
 Interseção deste conjunto com outro.
 
TVector< char > & Difference (const TVector< char > &v)
 Diferença deste conjunto em relação a outro.
 
bool Equal (const TVector< char > &v) const
 Verifica se dois vetores-conjunto são iguais.
 
bool Contained (const TVector< char > &v) const
 Verifica se este conjunto está contido no outro.
 
TVector< char > & Delete (int i)
 Remove o elemento na posição i deslocando os seguintes.
 
TVector< char > & Remove (char const &i)
 Remove todas as ocorrências de um dado elemento.
 
int Find (char &i, bool binary=false, int left=0, int right=-1)
 Procura um elemento no vetor.
 
TVector< char > & Replace (char const &iold, char const &inew)
 Substitui todas as ocorrências de um valor antigo por um novo.
 
TVector< char > & Sort (TVector< int > *idxvect=nullptr)
 Ordena todo o vetor, opcionalmente devolvendo índices ordenados.
 
void Sort (int start, int end=-1)
 Ordena um subintervalo [start,end] do vetor.
 
TVector< char > & RandomOrder ()
 Coloca os elementos em ordem aleatória (Fisher–Yates shuffle).
 
TVector< char > & Invert ()
 Inverte a ordem dos elementos no vetor.
 
TVector< char > & Reset (char const &i)
 Preenche todo o vetor com um mesmo valor.
 
int Distance (TVector< char > &v, int type=0)
 Calcula várias métricas de “distância” entre vetores.
 
char * begin () noexcept
 
const char * begin () const noexcept
 
char * end () noexcept
 
const char * end () const noexcept
 
TVector< char > & operator+= (const char &x)
 
TVector< char > & operator-= (const char &x)
 

Additional Inherited Members

- Static Public Attributes inherited from TVector< char >
static char erro
 Valor retornado em casos de acesso inválido.
 

Detailed Description

Definition at line 1098 of file TVector.h.

Constructor & Destructor Documentation

◆ TString() [1/3]

TString::TString ( )
inline

Definition at line 1115 of file TVector.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TString() [2/3]

TString::TString ( const char *  s)
inline

Definition at line 1121 of file TVector.h.

Here is the call graph for this function:

◆ TString() [3/3]

TString::TString ( int  v)
inline

Definition at line 1134 of file TVector.h.

Here is the call graph for this function:

Member Function Documentation

◆ Empty()

bool TString::Empty ( ) const
inlinevirtual

Verifica se a string é vazia.

Reimplemented from TVector< char >.

Definition at line 1184 of file TVector.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Hash()

unsigned int TString::Hash ( ) const
inline

Definition at line 1187 of file TVector.h.

◆ operator const char *()

TString::operator const char * ( ) const
inlinenoexcept

Definition at line 1139 of file TVector.h.

Here is the call graph for this function:

◆ operator*()

const char * TString::operator* ( ) const
inlinenoexcept

Definition at line 1145 of file TVector.h.

Here is the call graph for this function:

◆ operator+=()

TString & TString::operator+= ( const TString other)
inline

Definition at line 1176 of file TVector.h.

Here is the call graph for this function:

◆ printf()

TString & TString::printf ( const char *  fmt,
  ... 
)
inline

Definition at line 1150 of file TVector.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readLines()

TVector< TString > TString::readLines ( )
inline

Definition at line 1229 of file TVector.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tok()

TVector< TString > TString::tok ( const char *  delim = " \t\n\r") const
inline

Definition at line 1196 of file TVector.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeLines()

TString & TString::writeLines ( const TVector< TString > &  lines,
bool  append = false 
)
inline

Definition at line 1248 of file TVector.h.

Here is the call graph for this function:
Here is the caller graph for this function:

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