CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ShortString< StackSize, Type > Class Template Reference

#include <shortstring.h>

Inheritance diagram for ShortString< StackSize, Type >:

Public Member Functions

 ShortString ()
 
 ShortString (const ShortString &other)
 
 ShortString (const char *chars, const unsigned length)
 
 ShortString (const std::string &std_string)
 
ShortStringoperator= (const ShortString &other)
 
 ~ShortString ()
 
void Assign (const char *chars, const unsigned length)
 
void Assign (const ShortString &other)
 
void Append (const char *chars, const unsigned length)
 
void Truncate (unsigned new_length)
 
void Clear ()
 
const char * GetChars () const
 
unsigned GetLength () const
 
bool IsEmpty () const
 
std::string ToString () const
 
const char * c_str () const
 
bool operator== (const ShortString &other) const
 
bool operator!= (const ShortString &other) const
 
bool operator< (const ShortString &other) const
 
bool StartsWith (const ShortString &other) const
 
ShortString Suffix (const unsigned start_at) const
 

Static Public Member Functions

static uint64_t num_instances ()
 
static uint64_t num_overflows ()
 

Private Attributes

std::string * long_string_
 
char stack_ [StackSize+1]
 
unsigned char length_
 

Static Private Attributes

static atomic_int64 num_overflows_ = 0
 
static atomic_int64 num_instances_ = 0
 

Detailed Description

template<unsigned char StackSize, char Type>
class ShortString< StackSize, Type >

Definition at line 27 of file shortstring.h.

Constructor & Destructor Documentation

template<unsigned char StackSize, char Type>
ShortString< StackSize, Type >::ShortString ( )
inline

Definition at line 29 of file shortstring.h.

template<unsigned char StackSize, char Type>
ShortString< StackSize, Type >::ShortString ( const ShortString< StackSize, Type > &  other)
inline

Definition at line 34 of file shortstring.h.

template<unsigned char StackSize, char Type>
ShortString< StackSize, Type >::ShortString ( const char *  chars,
const unsigned  length 
)
inline

Definition at line 40 of file shortstring.h.

template<unsigned char StackSize, char Type>
ShortString< StackSize, Type >::ShortString ( const std::string &  std_string)
inlineexplicit

Definition at line 46 of file shortstring.h.

template<unsigned char StackSize, char Type>
ShortString< StackSize, Type >::~ShortString ( )
inline

Definition at line 59 of file shortstring.h.

Member Function Documentation

template<unsigned char StackSize, char Type>
void ShortString< StackSize, Type >::Assign ( const ShortString< StackSize, Type > &  other)
inline

Definition at line 76 of file shortstring.h.

template<unsigned char StackSize, char Type>
const char* ShortString< StackSize, Type >::c_str ( ) const
inline

Definition at line 145 of file shortstring.h.

Referenced by AbortIfHardlinked(), swissknife::CommandListReflog::CatalogCallback(), catalog::WritableCatalogManager::CloneTreeImpl(), swissknife::CommandCheck::CompareEntries(), cvmfs::cvmfs_getxattr(), cvmfs::cvmfs_open(), cvmfs::cvmfs_opendir(), cvmfs::cvmfs_readlink(), LibContext::CvmfsAttrFromDirent(), CatalogDiffTool< RoCatalogMgr >::DiffRec(), catalog::WritableCatalogManager::FinalizeCatalog(), ExternalURLMagicXattr::FinalizeValue(), swissknife::CommandCheck::Find(), NfsMapsSqlite::FindInode(), catalog::WritableCatalogManager::FixWeight(), cvmfs::GetDirentForInode(), cvmfs::GetDirentForPath(), NfsMapsLeveldb::GetPath(), cvmfs::GetPathForInode(), lru::InodeCache::Insert(), lru::PathCache::Insert(), lru::Md5PathCache::Insert(), NfsMapsSqlite::IssueInode(), catalog::AbstractCatalogManager< CatalogT >::LookupPath(), FuseInvalidator::MainInvalidator(), MakeShortSocketLink(), catalog::AbstractCatalogManager< CatalogT >::MountCatalog(), LibContext::Open(), catalog::Catalog::OpenDatabase(), ChunkListMagicXattr::PrepareValueFenced(), ChunksMagicXattr::PrepareValueFenced(), NfsMapsLeveldb::PutInode2Path(), LibContext::Readlink(), cvmfs::ReplyNegative(), receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >::ReportAddition(), receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >::ReportModification(), receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >::ReportRemoval(), NfsMapsSqlite::RetryGetInode(), SplitHardlink(), catalog::ClientCatalogManager::UnloadCatalog(), and catalog::WritableCatalog::VacuumDatabaseIfNecessary().

Here is the caller graph for this function:

template<unsigned char StackSize, char Type>
void ShortString< StackSize, Type >::Clear ( )
inline

Definition at line 117 of file shortstring.h.

template<unsigned char StackSize, char Type>
const char* ShortString< StackSize, Type >::GetChars ( ) const
inline
template<unsigned char StackSize, char Type>
unsigned ShortString< StackSize, Type >::GetLength ( ) const
inline

Definition at line 131 of file shortstring.h.

Referenced by catalog::WritableCatalogManager::AddDirectory(), ShortString< kDefaultMaxName, 1 >::Assign(), catalog::SqlDirentTouch::BindDirentBase(), catalog::SqlDirentWrite::BindDirentFields(), catalog::SqlNestedCatalogLookup::BindSearchPath(), CatalogDiffTool< RoCatalogMgr >::DiffRec(), catalog::SqlDirent::ExpandSymlink(), NfsMapsSqlite::FindInode(), catalog::Catalog::FindSubtree(), catalog::ClientCatalogManager::GetCatalogDescription(), LibContext::GetDirentForPath(), cvmfs::GetDirentForPath(), GetFileName(), NfsMapsLeveldb::GetInode(), GetParentPath(), glue::PathStore::Insert(), glue::PathMap::Insert(), FuseInvalidator::InvalidateDentry(), receiver::IsSubPath(), NfsMapsSqlite::IssueInode(), compat::inode_tracker_v2::PathMap::LookupInode(), glue::PathMap::LookupInodeByPath(), FuseInvalidator::MainInvalidator(), catalog::AbstractCatalogManager< CatalogT >::MountSubtree(), catalog::Catalog::NormalizePath(), catalog::Catalog::NormalizePath2(), LibContext::Open(), ShortString< kDefaultMaxName, 1 >::operator<(), ShortString< kDefaultMaxName, 1 >::operator==(), catalog::Catalog::PlantPath(), LibContext::Pread(), NfsMapsLeveldb::PutInode2Path(), LibContext::Readlink(), swissknife::CommandMigrate::MigrationWorker_20x::RemoveDanglingNestedMountpoints(), catalog::DirectoryEntryBase::size(), catalog::AbstractCatalogManager< CatalogT >::StageNestedCatalogAndUnlock(), and ShortString< kDefaultMaxName, 1 >::StartsWith().

Here is the caller graph for this function:

template<unsigned char StackSize, char Type>
static uint64_t ShortString< StackSize, Type >::num_instances ( )
inlinestatic

Definition at line 206 of file shortstring.h.

Referenced by TalkManager::MainResponder().

Here is the caller graph for this function:

template<unsigned char StackSize, char Type>
static uint64_t ShortString< StackSize, Type >::num_overflows ( )
inlinestatic

Definition at line 207 of file shortstring.h.

Referenced by TalkManager::MainResponder().

Here is the caller graph for this function:

template<unsigned char StackSize, char Type>
bool ShortString< StackSize, Type >::operator!= ( const ShortString< StackSize, Type > &  other) const
inline

Definition at line 165 of file shortstring.h.

template<unsigned char StackSize, char Type>
bool ShortString< StackSize, Type >::operator< ( const ShortString< StackSize, Type > &  other) const
inline

Definition at line 169 of file shortstring.h.

template<unsigned char StackSize, char Type>
ShortString& ShortString< StackSize, Type >::operator= ( const ShortString< StackSize, Type > &  other)
inline

Definition at line 53 of file shortstring.h.

template<unsigned char StackSize, char Type>
bool ShortString< StackSize, Type >::operator== ( const ShortString< StackSize, Type > &  other) const
inline

Definition at line 154 of file shortstring.h.

template<unsigned char StackSize, char Type>
bool ShortString< StackSize, Type >::StartsWith ( const ShortString< StackSize, Type > &  other) const
inline
template<unsigned char StackSize, char Type>
ShortString ShortString< StackSize, Type >::Suffix ( const unsigned  start_at) const
inline
template<unsigned char StackSize, char Type>
std::string ShortString< StackSize, Type >::ToString ( ) const
inline

Definition at line 141 of file shortstring.h.

Referenced by swissknife::CommandListCatalogs::CatalogCallback(), swissknife::CommandMigrate::CatalogCallback(), catalog::WritableCatalogManager::CatalogUploadCallback(), catalog::WritableCatalogManager::CloneTreeImpl(), catalog::WritableCatalogManager::CreateCatalog(), catalog::WritableCatalogManager::CreateNestedCatalog(), swissknife::CommandMigrate::CreateNestedCatalogMarkerDirent(), cvmfs::cvmfs_open(), cvmfs::cvmfs_read(), catalog::AbstractCatalogManager< CatalogT >::DetachSiblings(), LHashMagicXattr::FinalizeValue(), RawlinkMagicXattr::FinalizeValue(), swissknife::CommandCheck::Find(), catalog::WritableCatalogManager::FixWeight(), LibContext::GetNestedCatalogAttr(), swissknife::CommandMigrate::GetNestedCatalogMarkerDirent(), catalog::Catalog::IsAutogenerated(), catalog::AbstractCatalogManager< CatalogT >::LoadFreeCatalog(), Tracer::MainFlush(), TalkManager::MainResponder(), MakeRelative(), swissknife::CommandMigrate::MigrationWorker_20x::MigrateFileMetadata(), catalog::WritableCatalog::Partition(), LibContext::Pread(), catalog::WritableCatalogManager::RemoveNestedCatalog(), anonymous_namespace{commit_processor.cc}::RemoveRepoName(), anonymous_namespace{repository_diff.cc}::DiffForwarder::ReportAddition(), anonymous_namespace{repository_diff.cc}::DiffForwarder::ReportModification(), receiver::CatalogMergeTool< RwCatalogMgr, RoCatalogMgr >::ReportModification(), anonymous_namespace{repository_diff.cc}::DiffForwarder::ReportRemoval(), and swissknife::CommandMigrate::PendingCatalog::root_path().

Here is the caller graph for this function:

template<unsigned char StackSize, char Type>
void ShortString< StackSize, Type >::Truncate ( unsigned  new_length)
inline

Truncates the current string to be of size smaller or equal to current size

Note: Can lead to a heap allocated string that is shorter than the reserved stack space.

Definition at line 108 of file shortstring.h.

Referenced by CatalogDiffTool< RoCatalogMgr >::DiffRec().

Here is the caller graph for this function:

Member Data Documentation

template<unsigned char StackSize, char Type>
unsigned char ShortString< StackSize, Type >::length_
private

Definition at line 212 of file shortstring.h.

template<unsigned char StackSize, char Type>
std::string* ShortString< StackSize, Type >::long_string_
private

Definition at line 210 of file shortstring.h.

template<unsigned char StackSize, char Type>
atomic_int64 ShortString< StackSize, Type >::num_instances_ = 0
staticprivate

Definition at line 214 of file shortstring.h.

template<unsigned char StackSize, char Type>
atomic_int64 ShortString< StackSize, Type >::num_overflows_ = 0
staticprivate

Definition at line 213 of file shortstring.h.

template<unsigned char StackSize, char Type>
char ShortString< StackSize, Type >::stack_[StackSize+1]
private

Definition at line 211 of file shortstring.h.


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