Exemplo n.º 1
0
    // Create a owned copy of the string and replace all occurences of from with to in it.
    public Utf8String Replace(byte from, byte to)
    {
        var length      = Length;
        var newPtr      = ByteStringFunctions.CopyString(_path, length);
        var numReplaced = ByteStringFunctions.Replace(newPtr, length, from, to);

        return(new Utf8String().Setup(newPtr, length, numReplaced == 0 ? _crc32 : null, true, true, IsAsciiLowerInternal, IsAsciiInternal));
    }
Exemplo n.º 2
0
    // Create an owned copy of the given string.
    public Utf8String Clone()
    {
        var ret = new Utf8String();

        ret._length = _length | OwnedFlag | NullTerminatedFlag;
        ret._path   = ByteStringFunctions.CopyString(Path, Length);
        ret._crc32  = Crc32;
        return(ret);
    }