Exemplo n.º 1
0
MFString MFString::GetExtension() const
{
	int dot = FindCharReverse('.');
	if(dot > FindCharReverse('/') && dot > FindCharReverse('\\'))
		return SubStr(dot);
	return MFString();
}
Exemplo n.º 2
0
void String::TruncateToRightSection(char separator, bool exclude_separator)
{
    if (_meta && separator)
    {
        size_t slice_at = FindCharReverse(separator);
        if (slice_at != -1)
        {
            TruncateToRight(exclude_separator ? _meta->Length - slice_at - 1 : _meta->Length - slice_at);
        }
    }
}
Exemplo n.º 3
0
MFString& MFString::TruncateExtension()
{
	int dot = FindCharReverse('.');
	if(dot >= 0)
	{
		pData->pMemory[dot] = 0;
		pData->bytes = dot;
	}

	return *this;
}
Exemplo n.º 4
0
void String::ClipRightSection(char separator, bool include_separator)
{
    if (_meta && separator)
    {
        size_t slice_at = FindCharReverse(separator);
        if (slice_at != -1)
        {
            ClipRight(include_separator ? _meta->Length - slice_at : _meta->Length - slice_at - 1);
        }
        else
            Empty();
    }
}
Exemplo n.º 5
0
String String::RightSection(char separator, bool exclude_separator) const
{
    if (_meta && separator)
    {
        size_t slice_at = FindCharReverse(separator);
        if (slice_at != -1)
        {
            size_t count = exclude_separator ? _meta->Length - slice_at - 1 : _meta->Length - slice_at;
            return Right(count);
        }
    }
    return *this;
}
Exemplo n.º 6
0
// Extract rightmost part, separated by the given char
String String::RightSection(char separator, bool exclude_separator) const
{
    if (_meta && separator)
    {
        int slice_at = FindCharReverse(separator);
        if (slice_at >= 0)
        {
            int count = exclude_separator ? _meta->Length - slice_at - 1 : _meta->Length - slice_at;
            return Right(count);
        }
    }
    return String();
}