View source code
Display the source code in dmd/expression.d from which this
page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a
Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
local clone.
Class dmd.expression.StringExp
Fields
Name | Type | Description |
---|---|---|
committed
|
bool | Whether the string literal's type is fixed |
hexString
|
bool | If the string is parsed from a hex string literal |
Methods
Name | Description |
---|---|
borrowData
()
|
Borrow a slice of the data, so the caller can modify it in-place (!) |
compare
(se2)
|
Compare two StringExp by length, then value
|
getCodeUnit
(i)
|
Get the code unit at index i |
getIndex
(i)
|
|
numberOfCodeUnits
(tynto)
|
Return the number of code units the string would be if it were re-encoded as tynto. |
peekData
()
|
Get a slice of the data. |
setCodeUnit
(i, c)
|
Set the code unit at index i to c |
setData
(s, len, sz)
|
Set new string data.
this becomes the new owner of the data.
|
toStringz
()
|
Convert string contents to a 0 terminated string, allocated by mem.xmalloc(). |
writeTo
(dest, zero, tyto)
|
Write the contents of the string to dest. Use numberOfCodeUnits() to determine size of result. |
accept
(v)
|
Visits this AST node using the given visitor. |
addressOf
()
|
Take address of expression. |
checkReadModifyWrite
(rmwOp, ex)
|
Check whether the expression allows RMW operations, error with rmw operator diagnostic if not. ex is the RHS expression, or NULL if ++/-- is used (for diagnostics) Returns true if error occurs. |
checkType
()
|
Check that the expression has a valid type. If not, generates an error "... has no type". |
checkValue
()
|
Check that the expression has a valid value. If not, generates an error "... has no value". |
combine
(e1, e2)
|
Combine e1 and e2 by CommaExp if both are not NULL. |
copy
()
|
Does *not* do a deep copy. |
deinitialize
()
|
Deinitializes the global state of the compiler. |
deref
()
|
If this is a reference, dereference it. |
extractLast
(e, e0)
|
If 'e' is a tree of commas, returns the rightmost expression by stripping off it from the tree. The remained part of the tree is returned via e0. Otherwise 'e' is directly returned and e0 is set to NULL. |
factory
(classname)
|
Create instance of class specified by the fully qualified name classname. The class must either have no constructors or have a default constructor. |
isIdentical
(e)
|
Identical, not just equal. I.e. NaNs with different bit patterns are not identical |
isLvalue
()
|
Return !=0 if expression is an lvalue. |
opCmp
(o)
|
Compare with another Object obj. |
opEquals
(o)
|
Test whether this is equal to o .
The default implementation only compares by identity (using the is operator).
Generally, overrides and overloads for opEquals should attempt to compare objects by their contents.
A class will most likely want to add an overload that takes your specific type as the argument
and does the content comparison. Then you can override this and forward it to your specific
typed overload with a cast. Remember to check for null on the typed overload.
|
size
()
|
|
toBool
()
|
Statically evaluate this expression to a bool if possible
|
toHash
()
|
Compute hash function for Object. |
toString
()
|
|
toString
()
|
Convert Object to a human readable string. |
https
//dlang.org/spec/expression.html#string_literals
Authors
License
Copyright © 1999-2024 by the D Language Foundation | Page generated by ddox.