MythTV
master
|
Functions | |
MBASE_PUBLIC bool | isValidUTF8 (const QByteArray &data) |
QString | intToPaddedString (int n, int width=2) |
Creates a zero padded string representation of an integer. More... | |
QString | indentSpaces (unsigned int level, unsigned int size=4) |
QString | bool_to_string (bool val) |
This is equivalent to QVariant(bool).toString() More... | |
MBASE_PUBLIC int | naturalCompare (const QString &_a, const QString &_b, Qt::CaseSensitivity caseSensitivity=Qt::CaseSensitive) |
This method chops the input a and b into pieces of digits and non-digits (a1.05 becomes a | 1 | . More... | |
bool | naturalSortCompare (const QString &a, const QString &b, Qt::CaseSensitivity caseSensitivity=Qt::CaseSensitive) |
naturalCompare as a std::sort compatible function (ignoring the third parameter, which is never used). More... | |
MBASE_PUBLIC QString | formatKBytes (int64_t sizeKB, int prec=1) |
MBASE_PUBLIC QString | formatBytes (int64_t sizeB, int prec=1) |
std::vector< std::string_view > | split_sv (const std::string_view s, const std::string_view delimiter) |
Split a std::string_view into a std::vector of std::string_view s. More... | |
bool StringUtil::isValidUTF8 | ( | const QByteArray & | data | ) |
Definition at line 47 of file stringutil.cpp.
Referenced by WebSocketWorker::HandleCloseConnection(), WebSocketWorker::HandleDataFrame(), and WebSocketWorker::SendText().
|
inline |
Creates a zero padded string representation of an integer.
n | integer to convert |
width | minimum string length including sign, if any |
Definition at line 27 of file stringutil.h.
Referenced by MythDate::formatTime(), VideoMetadata::GetText(), AvFormatDecoder::OpenFile(), PlaybackBox::saveRecMetadata(), VideoMetadata::toMap(), ResultItem::toMap(), ProgramInfo::ToMap(), RecordingSelector::updateRecordingList(), and MythBDBuffer::UpdateTitleInfo().
|
inline |
Definition at line 36 of file stringutil.h.
Referenced by VirtualChannelTable::ChannelStringXML(), RecordingQuality::toStringXML(), CarrierDefinitionSubtable::toStringXML(), SpliceDescriptor::toStringXML(), MasterGuideTable::toStringXML(), ModulationModeSubtable::toStringXML(), SCTENetworkInformationTable::toStringXML(), NetworkTextTable::toStringXML(), VirtualChannelTable::toStringXML(), DefinedChannelsMapSubtable::toStringXML(), MPEGDescriptor::toStringXML(), VirtualChannelMapSubtable::toStringXML(), InverseChannelMapSubtable::toStringXML(), ShortVirtualChannelTable::toStringXML(), PSIPTable::toStringXML(), SCTESystemTimeTable::toStringXML(), ProgramAssociationTable::toStringXML(), SystemTimeTable::toStringXML(), ProgramMapTable::toStringXML(), ConditionalAccessTable::toStringXML(), SpliceTimeView::toStringXML(), SpliceInsertView::toStringXML(), SpliceInformationTable::toStringXML(), VirtualChannelTable::XMLChannelValues(), and PSIPTable::XMLValues().
|
inline |
This is equivalent to QVariant(bool).toString()
Definition at line 44 of file stringutil.h.
Referenced by ModulationModeSubtable::toStringXML(), DefinedChannelsMapSubtable::toStringXML(), VirtualChannelMapSubtable::toStringXML(), SystemTimeTable::toStringXML(), SpliceInsertView::toStringXML(), VirtualChannelTable::XMLChannelValues(), CableVirtualChannelTable::XMLChannelValues(), and PSIPTable::XMLValues().
int StringUtil::naturalCompare | ( | const QString & | _a, |
const QString & | _b, | ||
Qt::CaseSensitivity | caseSensitivity = Qt::CaseSensitive |
||
) |
This method chops the input a and b into pieces of digits and non-digits (a1.05 becomes a | 1 | .
| 05) and compares these pieces of a and b to each other (first with first, second with second, ...).
This is based on the natural sort order code code by Martin Pool http://sourcefrog.net/projects/natsort/ Martin Pool agreed to license this under LGPL or GPL.
Definition at line 160 of file stringutil.cpp.
Referenced by comp_title(), lt_callsign(), lt_smart(), naturalSortCompare(), TitleSort::operator()(), ProgramCountSort::operator()(), ProgramRecCountSort::operator()(), ProgramLastRecordSort::operator()(), ProgramAvgDelaySort::operator()(), plPrevTitleSort(), plTitleSort(), VideoMetadataImp::sortBefore(), Bookmark::sortByName(), and NewsSite::sortByName().
|
inline |
naturalCompare as a std::sort compatible function (ignoring the third parameter, which is never used).
Definition at line 57 of file stringutil.h.
Referenced by comp_sorttitle_lt(), comp_sorttitle_lt_rev(), VideoFilterSettings::meta_less_than(), anonymous_namespace{editvideometadata.cpp}::title_sort< T >::operator()(), SingleValueImp::sort(), and metadata_path_sort::sort().
QString StringUtil::formatKBytes | ( | int64_t | sizeKB, |
int | prec = 1 |
||
) |
Definition at line 357 of file stringutil.cpp.
Referenced by ProfileDialog::Create(), StatusBox::doAutoExpireList(), SelectDestination::filenameEditLostFocus(), formatBytes(), ProfileDialog::profileChanged(), MythBurn::profileChanged(), SelectDestination::setDestination(), ExportNative::titleChanged(), RecordingSelector::titleChanged(), VideoSelector::titleChanged(), MythBurn::updateArchiveList(), FileSelector::updateFileList(), RecordingSelector::updateRecordingList(), and usage_str_kb().
QString StringUtil::formatBytes | ( | int64_t | sizeB, |
int | prec = 1 |
||
) |
Definition at line 378 of file stringutil.cpp.
Referenced by CheckRecordings().
|
inline |
Split a std::string_view
into a std::vector
of std::string_view
s.
s | String to split, may be empty. |
delimiter | String to determine where to split. |
Definition at line 74 of file stringutil.h.
Referenced by AvFormatDecoder::ScanTeletextCaptions().