Overview
  • Namespace
  • Class

Namespaces

  • apemsel
    • AttributedString

Classes

  • AttributedString
  • MutableAttributedString
  • TokenizedAttributedString

Class MutableAttributedString

Extends AttributedString to support a mutable (changeable) string.

During insert and delete operations the attribute layers are updated as smart as possible.

apemsel\AttributedString\AttributedString implements Countable, ArrayAccess
Extended by apemsel\AttributedString\MutableAttributedString
Namespace: apemsel\AttributedString
Author: Adrian Pemsel apemsel@gmail.com
Located at MutableAttributedString.php

Methods summary

public
# insert( integer $pos, string $string )

Insert string at given offset

Insert string at given offset

Parameters

$pos
offset
$string
string to be inserted
public
# delete( integer $pos, integer $length )

Delete substring of given offset and length

Delete substring of given offset and length

Parameters

$pos
offset
$length
length
protected static string
# mb_substr_replace( string $string, string $replacement, integer $start, integer $length = NULL )

Missing mb_substr_replace() implementation

Missing mb_substr_replace() implementation

Parameters

$string
string to work on
$replacement
replacement string
$start
offset
$length
length

Returns

string
modified string

See

https://gist.github.com/stemar/8287074 Original source
public
# offsetSet( integer $offset, $value )

Replace char at given offset

Replace char at given offset

Parameters

$offset
offset
$value

Throws

InvalidArgumentException
always

Overrides

apemsel\AttributedString\AttributedString::offsetSet
public
# offsetUnset( integer $offset )

Unset char at given offset

Unset char at given offset

Parameters

$offset
offset

Throws

InvalidArgumentException
always

Overrides

apemsel\AttributedString\AttributedString::offsetUnset

Methods inherited from apemsel\AttributedString\AttributedString

__construct(), __toString(), attributeToString(), attributesAt(), byteToCharOffset(), byteToCharOffsetString(), charToByteOffset(), combineAttributes(), count(), createAttribute(), deleteAttribute(), enablebyteToCharCache(), filter(), hasAttribute(), is(), offsetExists(), offsetGet(), searchAttribute(), setLength(), setPattern(), setRange(), setSubstring(), substrings(), toHtml(), utf8CharLen()

Properties summary

Properties inherited from apemsel\AttributedString\AttributedString

$attributes, $byteToChar, $length, $string

API documentation generated by ApiGen