Object

ru.makkarpov.scalingua

StringUtils

Related Doc: package scalingua

Permalink

object StringUtils

Provides various string functions that are useful both in macros and in I18n code, such as string interpolations, escaping and unescaping.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. StringUtils
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. class InvalidInterpolationException extends IllegalArgumentException

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val VariableCharacter: Char

    Permalink

    Interpolation placeholder character

  5. val VariableParentheses: (Char, Char)

    Permalink

    Opening and closing interpolation parentheses

  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def escape(s: String): String

    Permalink

    Converts all non-letter and non-printable characters in s to their escape codes.

    Converts all non-letter and non-printable characters in s to their escape codes.

    s

    Raw string to escape

    returns

    Escaped version of s

  11. def extractVariables(msg: String): Set[String]

    Permalink

    Extracts all referred variables from string and returns a Set with names.

    Extracts all referred variables from string and returns a Set with names.

    msg

    Interpolation string

    returns

    Set of variable names referred in msg

  12. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  14. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  15. def interpolate[R](msg: String, args: (String, Any)*)(implicit format: OutputFormat[R]): R

    Permalink

    Replaces all occurences of placeholders like %(var) to corresponding variables in args with respect to specified OutputFormat (all placeholders will be escaped).

    Replaces all occurences of placeholders like %(var) to corresponding variables in args with respect to specified OutputFormat (all placeholders will be escaped). % can be escaped as %%. Note: for performance reasons this function will not use any Maps to index variables, it will use linear search every time it encounters a variable.

    R

    Result type

    msg

    Interpolation string

    args

    Interpolation variables

    format

    Desired OutputFormat summoned implicitly

    returns

    Interpolation result wrapped by OutputFormat

  16. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  21. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  22. def unescape(s: String): String

    Permalink

    Convert escape sequences like \\n to their meanings.

    Convert escape sequences like \\n to their meanings. Differs from StringContext.treatEscapes because latter does not handle \\uXXXX escape codes.

    s

    String with literal escape codes

    returns

    s having escape codes replaced with their meanings.

  23. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped