OCC.Core.TCollection module

TCollection module, see official documentation at https://www.opencascade.com/doc/occt-7.4.0/refman/html/package_tcollection.html

class SwigPyIterator(*args, **kwargs)

Bases: object

advance()
copy()
decr()
distance()
equal()
incr()
next()
previous()
property thisown

The membership flag

value()
class TCollection_AsciiString(*args)

Bases: object

  • Initializes a AsciiString to an empty AsciiString.
    rtype

    None* Initializes a AsciiString with a CString.

    param message

    type message

    char *

    rtype

    None* Initializes a AsciiString with a CString.

    param message

    type message

    char *

    param aLen

    type aLen

    int

    rtype

    None* Initializes a AsciiString with a single character.

    param aChar

    type aChar

    Standard_Character

    rtype

    None* Initializes an AsciiString with <length> space allocated. and filled with <filler>. This is usefull for buffers.

    param length

    type length

    int

    param filler

    type filler

    Standard_Character

    rtype

    None* Initializes an AsciiString with an integer value

    param value

    type value

    int

    rtype

    None* Initializes an AsciiString with a real value

    param value

    type value

    float

    rtype

    None* Initializes a AsciiString with another AsciiString.

    param astring

    type astring

    TCollection_AsciiString

    rtype

    None* Move constructor

    param theOther

    type theOther

    TCollection_AsciiString

    rtype

    None* Initializes a AsciiString with copy of another AsciiString concatenated with the message character.

    param astring

    type astring

    TCollection_AsciiString

    param message

    type message

    Standard_Character

    rtype

    None* Initializes a AsciiString with copy of another AsciiString concatenated with the message string.

    param astring

    type astring

    TCollection_AsciiString

    param message

    type message

    char *

    rtype

    None* Initializes a AsciiString with copy of another AsciiString concatenated with the message string.

    param astring

    type astring

    TCollection_AsciiString

    param message

    type message

    TCollection_AsciiString

    rtype

    None* Creation by converting an extended string to an ascii string. If replaceNonAscii is non-null charecter, it will be used in place of any non-ascii character found in the source string. Otherwise, creates UTF-8 unicode string.

    param astring

    type astring

    TCollection_ExtendedString

    param replaceNonAscii

    default value is 0

    type replaceNonAscii

    Standard_Character

    rtype

    None* Initialize UTF-8 Unicode string from wide-char string considering it as Unicode string (the size of wide char is a platform-dependent - e.g. on Windows wchar_t is UTF-16). //! This constructor is unavailable if application is built with deprecated msvc option ‘-Zc:wchar_t-‘, since OCCT itself is never built with this option.

    param theStringUtf

    type theStringUtf

    Standard_WideChar *

    rtype

    None

AssignCat()
  • Appends <other> to me. This is an unary operator.
    param other

    type other

    Standard_Character

    rtype

    None* Appends <other> to me. This is an unary operator.

    param other

    type other

    int

    rtype

    None* Appends <other> to me. This is an unary operator.

    param other

    type other

    float

    rtype

    None* Appends <other> to me. This is an unary operator. ex: aString += ‘Dummy’ To catenate more than one CString, you must put a AsciiString before. Example: aString += ‘Hello ‘ + ‘Dolly’ IS NOT VALID ! But astring += anotherString + ‘Hello ‘ + ‘Dolly’ is valid.

    param other

    type other

    char *

    rtype

    None* Appends <other> to me. This is an unary operator. Example: aString += anotherString

    param other

    type other

    TCollection_AsciiString

    rtype

    None

Capitalize()
  • Converts the first character into its corresponding upper-case character and the other characters into lowercase Example: before me = ‘hellO ‘ after me = ‘Hello ‘
    rtype

    None

Cat()
  • Appends <other> to me. Syntax: aString = aString + ‘Dummy’ Example: aString contains ‘I say ‘ aString = aString + ‘Hello ‘ + ‘Dolly’ gives ‘I say Hello Dolly’ To catenate more than one CString, you must put a String before. So the following example is WRONG ! aString = ‘Hello ‘ + ‘Dolly’ THIS IS NOT ALLOWED This rule is applicable to AssignCat (operator +=) too.
    param other

    type other

    Standard_Character

    rtype

    TCollection_AsciiString* Appends <other> to me. Syntax: aString = aString + 15; Example: aString contains ‘I say ‘ gives ‘I say 15’ To catenate more than one CString, you must put a String before. So the following example is WRONG ! aString = ‘Hello ‘ + ‘Dolly’ THIS IS NOT ALLOWED This rule is applicable to AssignCat (operator +=) too.

    param other

    type other

    int

    rtype

    TCollection_AsciiString* Appends <other> to me. Syntax: aString = aString + 15.15; Example: aString contains ‘I say ‘ gives ‘I say 15.15’ To catenate more than one CString, you must put a String before. So the following example is WRONG ! aString = ‘Hello ‘ + ‘Dolly’ THIS IS NOT ALLOWED This rule is applicable to AssignCat (operator +=) too.

    param other

    type other

    float

    rtype

    TCollection_AsciiString* Appends <other> to me. Syntax: aString = aString + ‘Dummy’ Example: aString contains ‘I say ‘ aString = aString + ‘Hello ‘ + ‘Dolly’ gives ‘I say Hello Dolly’ To catenate more than one CString, you must put a String before. So the following example is WRONG ! aString = ‘Hello ‘ + ‘Dolly’ THIS IS NOT ALLOWED This rule is applicable to AssignCat (operator +=) too.

    param other

    type other

    char *

    rtype

    TCollection_AsciiString* Appends <other> to me. Example: aString = aString + anotherString

    param other

    type other

    TCollection_AsciiString

    rtype

    TCollection_AsciiString

Center()
  • Modifies this ASCII string so that its length becomes equal to Width and the new characters are equal to Filler. New characters are added both at the beginning and at the end of this string. If Width is less than the length of this ASCII string, nothing happens. Example TCollection_AsciiString myAlphabet(‘abcdef’); myAlphabet.Center(9,’ ‘); assert ( myAlphabet == ‘ abcdef ‘ );
    param Width

    type Width

    int

    param Filler

    type Filler

    Standard_Character

    rtype

    None

ChangeAll()
  • Substitutes all the characters equal to aChar by NewChar in the AsciiString <self>. The substitution can be case sensitive. If you don’t use default case sensitive, no matter wether aChar is uppercase or not. Example: me = ‘Histake’ -> ChangeAll(‘H’,’M’,Standard_True) gives me = ‘Mistake’
    param aChar

    type aChar

    Standard_Character

    param NewChar

    type NewChar

    Standard_Character

    param CaseSensitive

    default value is Standard_True

    type CaseSensitive

    bool

    rtype

    None

Clear()
  • Removes all characters contained in <self>. This produces an empty AsciiString.
    rtype

    None

Copy()
  • Copy <fromwhere> to <self>. Used as operator = Example: aString = anotherCString;
    param fromwhere

    type fromwhere

    char *

    rtype

    None* Copy <fromwhere> to <self>. Used as operator = Example: aString = anotherString;

    param fromwhere

    type fromwhere

    TCollection_AsciiString

    rtype

    None

EndsWith()
  • Determines whether the end of this string instance matches the specified string.
    param theEndString

    type theEndString

    TCollection_AsciiString

    rtype

    bool

FirstLocationInSet()
  • Returns the index of the first character of <self> that is present in <Set>. The search begins to the index FromIndex and ends to the the index ToIndex. Returns zero if failure. Raises an exception if FromIndex or ToIndex is out of range. Example: before me = ‘aabAcAa’, S = ‘Aa’, FromIndex = 1, Toindex = 7 after me = ‘aabAcAa’ returns 1
    param Set

    type Set

    TCollection_AsciiString

    param FromIndex

    type FromIndex

    int

    param ToIndex

    type ToIndex

    int

    rtype

    int

FirstLocationNotInSet()
  • Returns the index of the first character of <self> that is not present in the set <Set>. The search begins to the index FromIndex and ends to the the index ToIndex in <self>. Returns zero if failure. Raises an exception if FromIndex or ToIndex is out of range. Example: before me = ‘aabAcAa’, S = ‘Aa’, FromIndex = 1, Toindex = 7 after me = ‘aabAcAa’ returns 3
    param Set

    type Set

    TCollection_AsciiString

    param FromIndex

    type FromIndex

    int

    param ToIndex

    type ToIndex

    int

    rtype

    int

static HashCode()
  • Computes a hash code for the given ASCII string, in the range [1, theUpperBound]. Returns the same integer value as the hash function for TCollection_ExtendedString @param theAsciiString the ASCII string which hash code is to be computed @param theUpperBound the upper bound of the range a computing hash code must be within returns a computed hash code, in the range [1, theUpperBound]
    param theAsciiString

    type theAsciiString

    TCollection_AsciiString

    param theUpperBound

    type theUpperBound

    int

    rtype

    int

Insert()
  • Inserts a Character at position <where>. Example: aString contains ‘hy not ?’ aString.Insert(1,’W’); gives ‘Why not ?’ aString contains ‘Wh’ aString.Insert(3,’y’); gives ‘Why’ aString contains ‘Way’ aString.Insert(2,’h’); gives ‘Why’
    param where

    type where

    int

    param what

    type what

    Standard_Character

    rtype

    None* Inserts a CString at position <where>. Example: aString contains ‘O more’ aString.Insert(2,’nce’); gives ‘Once more’

    param where

    type where

    int

    param what

    type what

    char *

    rtype

    None* Inserts a AsciiString at position <where>.

    param where

    type where

    int

    param what

    type what

    TCollection_AsciiString

    rtype

    None

InsertAfter()
  • Pushing a string after a specific index in the string <self>. Raises an exception if Index is out of bounds. - less than 0 (InsertAfter), or less than 1 (InsertBefore), or - greater than the number of characters in this ASCII string. Example: before me = ‘cde’ , Index = 0 , other = ‘ab’ after me = ‘abcde’ , other = ‘ab’
    param Index

    type Index

    int

    param other

    type other

    TCollection_AsciiString

    rtype

    None

InsertBefore()
  • Pushing a string before a specific index in the string <self>. Raises an exception if Index is out of bounds. - less than 0 (InsertAfter), or less than 1 (InsertBefore), or - greater than the number of characters in this ASCII string. Example: before me = ‘cde’ , Index = 1 , other = ‘ab’ after me = ‘abcde’ , other = ‘ab’
    param Index

    type Index

    int

    param other

    type other

    TCollection_AsciiString

    rtype

    None

IntegerValue()
  • Converts a AsciiString containing a numeric expression to an Integer. Example: ‘215’ returns 215.
    rtype

    int

IsAscii()
  • Returns True if the AsciiString contains only ASCII characters between ‘ ‘ and ‘~’. This means no control character and no extended ASCII code.
    rtype

    bool

IsDifferent()
  • Returns true if there are differences between the characters in this ASCII string and ASCII string other. Note that this method is an alias of operator !=
    param other

    type other

    char *

    rtype

    bool* Returns true if there are differences between the characters in this ASCII string and ASCII string other. Note that this method is an alias of operator !=

    param other

    type other

    TCollection_AsciiString

    rtype

    bool

IsEmpty()
  • Returns True if the string <self> contains zero character.
    rtype

    bool

static IsEqual()
  • Returns true if the characters in this ASCII string are identical to the characters in ASCII string other. Note that this method is an alias of operator ==.
    param other

    type other

    char *

    rtype

    bool* Returns true if the characters in this ASCII string are identical to the characters in ASCII string other. Note that this method is an alias of operator ==.

    param other

    type other

    TCollection_AsciiString

    rtype

    bool* Returns True when the two strings are the same. (Just for HashCode for AsciiString)

    param string1

    type string1

    TCollection_AsciiString

    param string2

    type string2

    TCollection_AsciiString

    rtype

    bool* Returns True when the two strings are the same. (Just for HashCode for AsciiString)

    param string1

    type string1

    TCollection_AsciiString

    param string2

    type string2

    char *

    rtype

    bool

IsGreater()
  • Returns True if <self> is ‘ASCII’ greater than <other>.
    param other

    type other

    char *

    rtype

    bool* Returns True if <self> is ‘ASCII’ greater than <other>.

    param other

    type other

    TCollection_AsciiString

    rtype

    bool

IsIntegerValue()
  • Returns True if the AsciiString contains an integer value. Note: an integer value is considered to be a real value as well.
    rtype

    bool

IsLess()
  • Returns True if <self> is ‘ASCII’ less than <other>.
    param other

    type other

    char *

    rtype

    bool* Returns True if <self> is ‘ASCII’ less than <other>.

    param other

    type other

    TCollection_AsciiString

    rtype

    bool

IsRealValue()
  • Returns True if the AsciiString contains a real value. Note: an integer value is considered to be a real value as well.
    rtype

    bool

static IsSameString()
  • Returns True if the strings contain same characters.
    param theString1

    type theString1

    TCollection_AsciiString

    param theString2

    type theString2

    TCollection_AsciiString

    param theIsCaseSensitive

    type theIsCaseSensitive

    bool

    rtype

    bool

LeftAdjust()
  • Removes all space characters in the begining of the string.
    rtype

    None

LeftJustify()
  • left justify Length becomes equal to Width and the new characters are equal to Filler. If Width < Length nothing happens. Raises an exception if Width is less than zero. Example: before me = ‘abcdef’ , Width = 9 , Filler = ‘ ‘ after me = ‘abcdef ‘
    param Width

    type Width

    int

    param Filler

    type Filler

    Standard_Character

    rtype

    None

Length()
  • Returns number of characters in <self>. This is the same functionality as ‘strlen’ in C. Example TCollection_AsciiString myAlphabet(‘abcdef’); assert ( myAlphabet.Length() == 6 ); - 1 is the position of the first character in this string. - The length of this string gives the position of its last character. - Positions less than or equal to zero, or greater than the length of this string are invalid in functions which identify a character of this string by its position.
    rtype

    int

Location()
  • Returns an index in the string <self> of the first occurence of the string S in the string <self> from the starting index FromIndex to the ending index ToIndex returns zero if failure Raises an exception if FromIndex or ToIndex is out of range. Example: before me = ‘aabAaAa’, S = ‘Aa’, FromIndex = 1, ToIndex = 7 after me = ‘aabAaAa’ returns 4
    param other

    type other

    TCollection_AsciiString

    param FromIndex

    type FromIndex

    int

    param ToIndex

    type ToIndex

    int

    rtype

    int* Returns the index of the nth occurence of the character C in the string <self> from the starting index FromIndex to the ending index ToIndex. Returns zero if failure. Raises an exception if FromIndex or ToIndex is out of range. Example: before me = ‘aabAa’, N = 3, C = ‘a’, FromIndex = 1, ToIndex = 5 after me = ‘aabAa’ returns 5

    param N

    type N

    int

    param C

    type C

    Standard_Character

    param FromIndex

    type FromIndex

    int

    param ToIndex

    type ToIndex

    int

    rtype

    int

LowerCase()
  • Converts <self> to its lower-case equivalent. Example TCollection_AsciiString myString(‘Hello Dolly’); myString.UpperCase(); assert ( myString == ‘HELLO DOLLY’ ); myString.LowerCase(); assert ( myString == ‘hello dolly’ );
    rtype

    None

Prepend()
  • Inserts the string other at the beginning of this ASCII string. Example TCollection_AsciiString myAlphabet(‘cde’); TCollection_AsciiString myBegin(‘ab’); myAlphabet.Prepend(myBegin); assert ( myAlphabet == ‘abcde’ );
    param other

    type other

    TCollection_AsciiString

    rtype

    None

PrintToString(TCollection_AsciiString self) → std::string
ReadFromString(TCollection_AsciiString self, std::string src)
RealValue()
  • Converts an AsciiString containing a numeric expression. to a Real. Example: ex: ‘215’ returns 215.0. ex: ‘3.14159267’ returns 3.14159267.
    rtype

    float

Remove()
  • Erases <ahowmany> characters from position <where>, <where> included. Example: aString contains ‘Hello’ aString.Remove(2,2) erases 2 characters from position 2 This gives ‘Hlo’.
    param where

    type where

    int

    param ahowmany

    default value is 1

    type ahowmany

    int

    rtype

    None

RemoveAll()
  • Remove all the occurences of the character C in the string. Example: before me = ‘HellLLo’, C = ‘L’ , CaseSensitive = True after me = ‘Hello’
    param C

    type C

    Standard_Character

    param CaseSensitive

    type CaseSensitive

    bool

    rtype

    None* Removes every <what> characters from <self>.

    param what

    type what

    Standard_Character

    rtype

    None

RightAdjust()
  • Removes all space characters at the end of the string.
    rtype

    None

RightJustify()
  • Right justify. Length becomes equal to Width and the new characters are equal to Filler. if Width < Length nothing happens. Raises an exception if Width is less than zero. Example: before me = ‘abcdef’ , Width = 9 , Filler = ‘ ‘ after me = ‘ abcdef’
    param Width

    type Width

    int

    param Filler

    type Filler

    Standard_Character

    rtype

    None

Search()
  • Searches a CString in <self> from the beginning and returns position of first item <what> matching. it returns -1 if not found. Example: aString contains ‘Sample single test’ aString.Search(‘le’) returns 5
    param what

    type what

    char *

    rtype

    int* Searches an AsciiString in <self> from the beginning and returns position of first item <what> matching. It returns -1 if not found.

    param what

    type what

    TCollection_AsciiString

    rtype

    int

SearchFromEnd()
  • Searches a CString in a AsciiString from the end and returns position of first item <what> matching. It returns -1 if not found. Example: aString contains ‘Sample single test’ aString.SearchFromEnd(‘le’) returns 12
    param what

    type what

    char *

    rtype

    int* Searches a AsciiString in another AsciiString from the end and returns position of first item <what> matching. It returns -1 if not found.

    param what

    type what

    TCollection_AsciiString

    rtype

    int

SetValue()
  • Replaces one character in the AsciiString at position <where>. If <where> is less than zero or greater than the length of <self> an exception is raised. Example: aString contains ‘Garbake’ astring.Replace(6,’g’) gives <self> = ‘Garbage’
    param where

    type where

    int

    param what

    type what

    Standard_Character

    rtype

    None* Replaces a part of <self> by a CString. If <where> is less than zero or greater than the length of <self> an exception is raised. Example: aString contains ‘abcde’ aString.SetValue(4,’1234567’) gives <self> = ‘abc1234567’

    param where

    type where

    int

    param what

    type what

    char *

    rtype

    None* Replaces a part of <self> by another AsciiString.

    param where

    type where

    int

    param what

    type what

    TCollection_AsciiString

    rtype

    None

Split()
  • Splits a AsciiString into two sub-strings. Example: aString contains ‘abcdefg’ aString.Split(3) gives <self> = ‘abc’ and returns ‘defg’
    param where

    type where

    int

    rtype

    TCollection_AsciiString

StartsWith()
  • Determines whether the beginning of this string instance matches the specified string.
    param theStartString

    type theStartString

    TCollection_AsciiString

    rtype

    bool

SubString()
  • Creation of a sub-string of the string <self>. The sub-string starts to the index Fromindex and ends to the index ToIndex. Raises an exception if ToIndex or FromIndex is out of bounds Example: before me = ‘abcdefg’, ToIndex=3, FromIndex=6 after me = ‘abcdefg’ returns ‘cdef’
    param FromIndex

    type FromIndex

    int

    param ToIndex

    type ToIndex

    int

    rtype

    TCollection_AsciiString

Swap()
  • Exchange the data of two strings (without reallocating memory).
    param theOther

    type theOther

    TCollection_AsciiString

    rtype

    None

ToCString()
  • Returns pointer to AsciiString (char *). This is useful for some casual manipulations. Warning: Because this ‘char *’ is ‘const’, you can’t modify its contents.
    rtype

    char *

Token()
  • Extracts <whichone> token from <self>. By default, the <separators> is set to space and tabulation. By default, the token extracted is the first one (whichone = 1). <separators> contains all separators you need. If no token indexed by <whichone> is found, it returns empty AsciiString. Example: aString contains ‘This is a message’ aString.Token() returns ‘This’ aString.Token(‘ ‘,4) returns ‘message’ aString.Token(‘ ‘,2) returns ‘is’ aString.Token(‘ ‘,9) returns ‘’ Other separators than space character and tabulation are allowedaString contains ‘1234; test:message , value’ aString.Token(‘; :,’,4) returns ‘value’ aString.Token(‘; :,’,2) returns ‘test’
    param separators

    default value is ‘ ‘

    type separators

    char *

    param whichone

    default value is 1

    type whichone

    int

    rtype

    TCollection_AsciiString

Trunc()
  • Truncates <self> to <ahowmany> characters. Example: me = ‘Hello Dolly’ -> Trunc(3) -> me = ‘Hel’
    param ahowmany

    type ahowmany

    int

    rtype

    None

UpperCase()
  • Converts <self> to its upper-case equivalent.
    rtype

    None

UsefullLength()
  • Length of the string ignoring all spaces (‘ ‘) and the control character at the end.
    rtype

    int

Value()
  • Returns character at position <where> in <self>. If <where> is less than zero or greater than the lenght of <self>, an exception is raised. Example: aString contains ‘Hello’ aString.Value(2) returns ‘e’
    param where

    type where

    int

    rtype

    Standard_Character

property thisown

The membership flag

class TCollection_BaseSequence(*args, **kwargs)

Bases: object

Exchange()
  • Swaps elements which are located at positions <I> and <J> in <self>. Raises an exception if I or J is out of bound. Example: before me = (A B C), I = 1, J = 3 after me = (C B A)
    param I

    type I

    int

    param J

    type J

    int

    rtype

    None

IsEmpty()
  • returns True if the sequence <self> contains no elements.
    rtype

    bool

Length()
  • Returns the number of element(s) in the sequence. Returns zero if the sequence is empty.
    rtype

    int

Reverse()
  • Reverses the order of items on <self>. Example: before me = (A B C) after me = (C B A)
    rtype

    None

property thisown

The membership flag

class TCollection_BasicMap(*args, **kwargs)

Bases: object

Extent()
  • Returns the number of keys already stored in <self>.
    rtype

    int

IsEmpty()
  • Returns True when the map contains no keys. This is exactly Extent() == 0.
    rtype

    bool

NbBuckets()
  • Returns the number of buckets in <self>.
    rtype

    int

StatisticsToString(TCollection_BasicMap self) → std::string
property thisown

The membership flag

class TCollection_BasicMapIterator(*args, **kwargs)

Bases: object

More()
  • Returns true if there is a current entry for this iterator in the map. Use the function Next to set this iterator to the position of the next entry, if it exists.
    rtype

    bool

Next()
  • Sets this iterator to the position of the next entry of the map. Nothing is changed if there is no more entry to explore in the map: this iterator is always positioned on the last entry of the map but the function More returns false.
    rtype

    None

Reset()
  • Resets the iterator to the first node.
    rtype

    None

property thisown

The membership flag

class TCollection_ExtendedString(*args)

Bases: object

  • Initializes a ExtendedString to an empty ExtendedString.
    rtype

    None* Creation by converting a CString to an extended string. If <isMultiByte> is true then the string is treated as having UTF-8 coding. If it is not a UTF-8 then <isMultiByte> is ignored and each character is copied to ExtCharacter.

    param astring

    type astring

    char *

    param isMultiByte

    default value is Standard_False

    type isMultiByte

    bool

    rtype

    None* Creation by converting an ExtString to an extended string.

    param astring

    type astring

    Standard_ExtString

    rtype

    None* Initialize from wide-char string considering it as Unicode string (the size of wide char is a platform-dependent - e.g. on Windows wchar_t is UTF-16). //! This constructor is unavailable if application is built with deprecated msvc option ‘-Zc:wchar_t-‘, since OCCT itself is never built with this option.

    param theStringUtf

    type theStringUtf

    Standard_WideChar *

    rtype

    None* Initializes a AsciiString with a single character.

    param aChar

    type aChar

    Standard_Character

    rtype

    None* Initializes a ExtendedString with a single character.

    param aChar

    type aChar

    Standard_ExtCharacter

    rtype

    None* Initializes a ExtendedString with <length> space allocated. and filled with <filler>.This is useful for buffers.

    param length

    type length

    int

    param filler

    type filler

    Standard_ExtCharacter

    rtype

    None* Initializes an ExtendedString with an integer value

    param value

    type value

    int

    rtype

    None* Initializes an ExtendedString with a real value

    param value

    type value

    float

    rtype

    None* Initializes a ExtendedString with another ExtendedString.

    param astring

    type astring

    TCollection_ExtendedString

    rtype

    None* Move constructor

    param theOther

    type theOther

    TCollection_ExtendedString

    rtype

    None* Creation by converting an Ascii string to an extended string. The string is treated as having UTF-8 coding. If it is not a UTF-8 then each character is copied to ExtCharacter.

    param astring

    type astring

    TCollection_AsciiString

    rtype

    None

AssignCat()
  • Appends the other extended string to this extended string. Note that this method is an alias of operator +=. Example: aString += anotherString
    param other

    type other

    TCollection_ExtendedString

    rtype

    None

Cat()
  • Appends <other> to me.
    param other

    type other

    TCollection_ExtendedString

    rtype

    TCollection_ExtendedString

ChangeAll()
  • Substitutes all the characters equal to aChar by NewChar in the ExtendedString <self>. The substitution can be case sensitive. If you don’t use default case sensitive, no matter wether aChar is uppercase or not.
    param aChar

    type aChar

    Standard_ExtCharacter

    param NewChar

    type NewChar

    Standard_ExtCharacter

    rtype

    None

Clear()
  • Removes all characters contained in <self>. This produces an empty ExtendedString.
    rtype

    None

Copy()
  • Copy <fromwhere> to <self>. Used as operator =
    param fromwhere

    type fromwhere

    TCollection_ExtendedString

    rtype

    None

EndsWith()
  • Determines whether the end of this string instance matches the specified string.
    param theEndString

    type theEndString

    TCollection_ExtendedString

    rtype

    bool

static HashCode()
  • Returns a hashed value for the extended string within the range 1 .. theUpper. Note: if string is ASCII, the computed value is the same as the value computed with the HashCode function on a TCollection_AsciiString string composed with equivalent ASCII characters. @param theExtendedString the extended string which hash code is to be computed @param theUpperBound the upper bound of the range a computing hash code must be within returns a computed hash code, in the range [1, theUpperBound]
    param theString

    type theString

    TCollection_ExtendedString

    param theUpperBound

    type theUpperBound

    int

    rtype

    int

Insert()
  • Insert a Character at position <where>.
    param where

    type where

    int

    param what

    type what

    Standard_ExtCharacter

    rtype

    None* Insert a ExtendedString at position <where>.

    param where

    type where

    int

    param what

    type what

    TCollection_ExtendedString

    rtype

    None

IsAscii()
  • Returns True if the ExtendedString contains only ‘Ascii Range’ characters .
    rtype

    bool

IsDifferent()
  • Returns true if there are differences between the characters in this extended string and the other extended string. Note that this method is an alias of operator !=.
    param other

    type other

    Standard_ExtString

    rtype

    bool* Returns true if there are differences between the characters in this extended string and the other extended string. Note that this method is an alias of operator !=.

    param other

    type other

    TCollection_ExtendedString

    rtype

    bool

IsEmpty()
  • Returns True if this string contains no characters.
    rtype

    bool

static IsEqual()
  • Returns true if the characters in this extended string are identical to the characters in the other extended string. Note that this method is an alias of operator ==
    param other

    type other

    Standard_ExtString

    rtype

    bool* Returns true if the characters in this extended string are identical to the characters in the other extended string. Note that this method is an alias of operator ==

    param other

    type other

    TCollection_ExtendedString

    rtype

    bool* Returns true if the characters in this extended string are identical to the characters in the other extended string. Note that this method is an alias of operator ==.

    param theString1

    type theString1

    TCollection_ExtendedString

    param theString2

    type theString2

    TCollection_ExtendedString

    rtype

    bool

IsGreater()
  • Returns True if <self> is greater than <other>.
    param other

    type other

    Standard_ExtString

    rtype

    bool* Returns True if <self> is greater than <other>.

    param other

    type other

    TCollection_ExtendedString

    rtype

    bool

IsLess()
  • Returns True if <self> is less than <other>.
    param other

    type other

    Standard_ExtString

    rtype

    bool* Returns True if <self> is less than <other>.

    param other

    type other

    TCollection_ExtendedString

    rtype

    bool

Length()
  • Returns the number of 16-bit code units (might be greater than number of Unicode symbols if string contains surrogate pairs).
    rtype

    int

LengthOfCString()
  • Returns expected CString length in UTF8 coding. It can be used for memory calculation before converting to CString containing symbols in UTF8 coding.
    rtype

    int

PrintToString(TCollection_ExtendedString self) → std::string
Remove()
  • Erases <ahowmany> characters from position <where>,<where> included.
    param where

    type where

    int

    param ahowmany

    default value is 1

    type ahowmany

    int

    rtype

    None

RemoveAll()
  • Removes every <what> characters from <self>.
    param what

    type what

    Standard_ExtCharacter

    rtype

    None

Search()
  • Searches a ExtendedString in <self> from the beginning and returns position of first item <what> matching. it returns -1 if not found.
    param what

    type what

    TCollection_ExtendedString

    rtype

    int

SearchFromEnd()
  • Searches a ExtendedString in another ExtendedString from the end and returns position of first item <what> matching. it returns -1 if not found.
    param what

    type what

    TCollection_ExtendedString

    rtype

    int

SetValue()
  • Replaces one character in the ExtendedString at position <where>. If <where> is less than zero or greater than the length of <self> an exception is raised.
    param where

    type where

    int

    param what

    type what

    Standard_ExtCharacter

    rtype

    None* Replaces a part of <self> by another ExtendedString see above.

    param where

    type where

    int

    param what

    type what

    TCollection_ExtendedString

    rtype

    None

Split()
  • Splits this extended string into two sub-strings at position where. - The second sub-string (from position where + 1 of this string to the end) is returned in a new extended string. - this extended string is modified: its last characters are removed, it becomes equal to the first sub-string (from the first character to position where). Example: aString contains ‘abcdefg’ aString.Split(3) gives <self> = ‘abc’ and returns ‘defg’
    param where

    type where

    int

    rtype

    TCollection_ExtendedString

StartsWith()
  • Determines whether the beginning of this string instance matches the specified string.
    param theStartString

    type theStartString

    TCollection_ExtendedString

    rtype

    bool

Swap()
  • Exchange the data of two strings (without reallocating memory).
    param theOther

    type theOther

    TCollection_ExtendedString

    rtype

    None

ToExtString()
  • Returns pointer to ExtString
    rtype

    Standard_ExtString

ToUTF8CString()
  • Converts the internal <mystring> to UTF8 coding and returns length of the out CString. A memory for the <theCString> should be allocated before call!
    param theCString

    type theCString

    Standard_PCharacter

    rtype

    int

Token()
  • Extracts <whichone> token from <self>. By default, the <separators> is set to space and tabulation. By default, the token extracted is the first one (whichone = 1). <separators> contains all separators you need. If no token indexed by <whichone> is found, it returns an empty AsciiString. Example: aString contains ‘This is a message’ aString.Token() returns ‘This’ aString.Token(‘ ‘,4) returns ‘message’ aString.Token(‘ ‘,2) returns ‘is’ aString.Token(‘ ‘,9) returns ‘’ Other separators than space character and tabulation are allowedaString contains ‘1234; test:message , value’ aString.Token(‘; :,’,4) returns ‘value’ aString.Token(‘; :,’,2) returns ‘test’
    param separators

    type separators

    Standard_ExtString

    param whichone

    default value is 1

    type whichone

    int

    rtype

    TCollection_ExtendedString

Trunc()
  • Truncates <self> to <ahowmany> characters. Example: me = ‘Hello Dolly’ -> Trunc(3) -> me = ‘Hel’ Exceptions Standard_OutOfRange if ahowmany is greater than the length of this string.
    param ahowmany

    type ahowmany

    int

    rtype

    None

Value()
  • Returns character at position <where> in <self>. If <where> is less than zero or greater than the lenght of <self>, an exception is raised. Example: aString contains ‘Hello’ aString.Value(2) returns ‘e’ Exceptions Standard_OutOfRange if where lies outside the bounds of this extended string.
    param where

    type where

    int

    rtype

    Standard_ExtCharacter

property thisown

The membership flag

class TCollection_HAsciiString(*args)

Bases: OCC.Core.Standard.Standard_Transient

  • Initializes a HAsciiString to an empty AsciiString.
    rtype

    None* Initializes a HAsciiString with a CString.

    param message

    type message

    char *

    rtype

    None* Initializes a HAsciiString with a single character.

    param aChar

    type aChar

    Standard_Character

    rtype

    None* Initializes a HAsciiString with <length> space allocated. and filled with <filler>.This is useful for buffers.

    param length

    type length

    int

    param filler

    type filler

    Standard_Character

    rtype

    None* Initializes a HAsciiString with an integer value

    param value

    type value

    int

    rtype

    None* Initializes a HAsciiString with a real value

    param value

    type value

    float

    rtype

    None* Initializes a HAsciiString with a HAsciiString.

    param aString

    type aString

    TCollection_AsciiString

    rtype

    None* Initializes a HAsciiString with a HAsciiString.

    param aString

    type aString

    TCollection_HAsciiString

    rtype

    None* Initializes a HAsciiString with a HAsciiString. If replaceNonAscii is non-null charecter, it will be used in place of any non-ascii character found in the source string. Otherwise, raises OutOfRange exception if at least one character in the source string is not in the ‘Ascii range’.

    param aString

    type aString

    TCollection_HExtendedString

    param replaceNonAscii

    type replaceNonAscii

    Standard_Character

    rtype

    None

AssignCat()
  • Appends <other> to me.
    param other

    type other

    char *

    rtype

    None* Appends <other> to me. Example: aString = aString + anotherString

    param other

    type other

    TCollection_HAsciiString

    rtype

    None

Capitalize()
  • Converts the first character into its corresponding upper-case character and the other characters into lowercase. Example: before me = ‘hellO ‘ after me = ‘Hello ‘
    rtype

    None

Cat()
  • Creates a new string by concatenation of this ASCII string and the other ASCII string. Example: aString = aString + anotherString aString = aString + ‘Dummy’ aString contains ‘I say ‘ aString = aString + ‘Hello ‘ + ‘Dolly’ gives ‘I say Hello Dolly’ Warning: To catenate more than one CString, you must put a String before. So the following example is WRONG ! aString = ‘Hello ‘ + ‘Dolly’ THIS IS NOT ALLOWED This rule is applicable to AssignCat (operator +=) too.
    param other

    type other

    char *

    rtype

    opencascade::handle<TCollection_HAsciiString>* Creates a new string by concatenation of this ASCII string and the other ASCII string. Example: aString = aString + anotherString

    param other

    type other

    TCollection_HAsciiString

    rtype

    opencascade::handle<TCollection_HAsciiString>

Center()
  • Modifies this ASCII string so that its length becomes equal to Width and the new characters are equal to Filler. New characters are added both at the beginning and at the end of this string. If Width is less than the length of this ASCII string, nothing happens. Example opencascade::handle<TCollection_HAsciiString> myAlphabet = new TCollection_HAsciiString (‘abcdef’); myAlphabet->Center(9,’ ‘); assert ( !strcmp( myAlphabet->ToCString(), ‘ abcdef ‘) );
    param Width

    type Width

    int

    param Filler

    type Filler

    Standard_Character

    rtype

    None

ChangeAll()
  • Replaces all characters equal to aChar by NewChar in this ASCII string. The substitution is case sensitive if CaseSensitive is true (default value). If you do not use the default case sensitive option, it does not matter whether aChar is upper-case or not. Example opencascade::handle<TCollection_HAsciiString> myMistake = new TCollection_HAsciiString (‘Hather’); myMistake->ChangeAll(‘H’,’F’); assert ( !strcmp( myMistake->ToCString(), ‘Father’) );
    param aChar

    type aChar

    Standard_Character

    param NewChar

    type NewChar

    Standard_Character

    param CaseSensitive

    default value is Standard_True

    type CaseSensitive

    bool

    rtype

    None

Clear()
  • Removes all characters contained in <self>. This produces an empty HAsciiString.
    rtype

    None

static DownCast(t)
FirstLocationInSet()
  • Returns the index of the first character of <self> that is present in <Set>. The search begins to the index FromIndex and ends to the the index ToIndex. Returns zero if failure. Raises an exception if FromIndex or ToIndex is out of range Example: before me = ‘aabAcAa’, S = ‘Aa’, FromIndex = 1, Toindex = 7 after me = ‘aabAcAa’ returns 1
    param Set

    type Set

    TCollection_HAsciiString

    param FromIndex

    type FromIndex

    int

    param ToIndex

    type ToIndex

    int

    rtype

    int

FirstLocationNotInSet()
  • Returns the index of the first character of <self> that is not present in the set <Set>. The search begins to the index FromIndex and ends to the the index ToIndex in <self>. Returns zero if failure. Raises an exception if FromIndex or ToIndex is out of range. Example: before me = ‘aabAcAa’, S = ‘Aa’, FromIndex = 1, Toindex = 7 after me = ‘aabAcAa’ returns 3
    param Set

    type Set

    TCollection_HAsciiString

    param FromIndex

    type FromIndex

    int

    param ToIndex

    type ToIndex

    int

    rtype

    int

Insert()
  • Insert a Character at position <where>. Example: aString contains ‘hy not ?’ aString.Insert(1,’W’); gives ‘Why not ?’ aString contains ‘Wh’ aString.Insert(3,’y’); gives ‘Why’ aString contains ‘Way’ aString.Insert(2,’h’); gives ‘Why’
    param where

    type where

    int

    param what

    type what

    Standard_Character

    rtype

    None* Insert a HAsciiString at position <where>.

    param where

    type where

    int

    param what

    type what

    char *

    rtype

    None* Insert a HAsciiString at position <where>.

    param where

    type where

    int

    param what

    type what

    TCollection_HAsciiString

    rtype

    None

InsertAfter()
  • Inserts the other ASCII string a after a specific index in the string <self> Example: before me = ‘cde’ , Index = 0 , other = ‘ab’ after me = ‘abcde’ , other = ‘ab’
    param Index

    type Index

    int

    param other

    type other

    TCollection_HAsciiString

    rtype

    None

InsertBefore()
  • Inserts the other ASCII string a before a specific index in the string <self> Raises an exception if Index is out of bounds Example: before me = ‘cde’ , Index = 1 , other = ‘ab’ after me = ‘abcde’ , other = ‘ab’
    param Index

    type Index

    int

    param other

    type other

    TCollection_HAsciiString

    rtype

    None

IntegerValue()
  • Converts a HAsciiString containing a numeric expression to an Integer. Example: ‘215’ returns 215.
    rtype

    int

IsAscii()
  • Returns True if the string contains only ASCII characters between ‘ ‘ and ‘~’. This means no control character and no extended ASCII code.
    rtype

    bool

IsDifferent()
  • Returns True if the string S not contains same characters than the string <self>.
    param S

    type S

    TCollection_HAsciiString

    rtype

    bool

IsEmpty()
  • Returns True if the string <self> contains zero character
    rtype

    bool

IsGreater()
  • Returns True if <self> is ‘ASCII’ greater than <other>.
    param other

    type other

    TCollection_HAsciiString

    rtype

    bool

IsIntegerValue()
  • Returns True if the string contains an integer value.
    rtype

    bool

IsLess()
  • Returns True if <self> is ‘ASCII’ less than <other>.
    param other

    type other

    TCollection_HAsciiString

    rtype

    bool

IsRealValue()
  • Returns True if the string contains a real value.
    rtype

    bool

IsSameState()
Parameters

other

type other

TCollection_HAsciiString

rtype

bool

IsSameString()
  • Returns True if the string S contains same characters than the string <self>.
    param S

    type S

    TCollection_HAsciiString

    rtype

    bool* Returns True if the string S contains same characters than the string <self>.

    param S

    type S

    TCollection_HAsciiString

    param CaseSensitive

    type CaseSensitive

    bool

    rtype

    bool

LeftAdjust()
  • Removes all space characters in the begining of the string
    rtype

    None

LeftJustify()
  • Left justify. Length becomes equal to Width and the new characters are equal to Filler if Width < Length nothing happens Raises an exception if Width is less than zero Example: before me = ‘abcdef’ , Width = 9 , Filler = ‘ ‘ after me = ‘abcdef ‘
    param Width

    type Width

    int

    param Filler

    type Filler

    Standard_Character

    rtype

    None

Length()
  • Returns number of characters in <self>. This is the same functionality as ‘strlen’ in C.
    rtype

    int

Location()
  • returns an index in the string <self> of the first occurence of the string S in the string <self> from the starting index FromIndex to the ending index ToIndex returns zero if failure Raises an exception if FromIndex or ToIndex is out of range. Example: before me = ‘aabAaAa’, S = ‘Aa’, FromIndex = 1, ToIndex = 7 after me = ‘aabAaAa’ returns 4
    param other

    type other

    TCollection_HAsciiString

    param FromIndex

    type FromIndex

    int

    param ToIndex

    type ToIndex

    int

    rtype

    int* Returns the index of the nth occurence of the character C in the string <self> from the starting index FromIndex to the ending index ToIndex. Returns zero if failure. Raises an exception if FromIndex or ToIndex is out of range Example: before me = ‘aabAa’, N = 3, C = ‘a’, FromIndex = 1, ToIndex = 5 after me = ‘aabAa’ returns 5

    param N

    type N

    int

    param C

    type C

    Standard_Character

    param FromIndex

    type FromIndex

    int

    param ToIndex

    type ToIndex

    int

    rtype

    int

LowerCase()
  • Converts <self> to its lower-case equivalent.
    rtype

    None

Prepend()
  • Inserts the other string at the begining of the string <self> Example: before me = ‘cde’ , S = ‘ab’ after me = ‘abcde’ , S = ‘ab’
    param other

    type other

    TCollection_HAsciiString

    rtype

    None

PrintToString(TCollection_HAsciiString self) → std::string
RealValue()
  • Converts a string containing a numeric expression to a Real. Example: ‘215’ returns 215.0. ‘3.14159267’ returns 3.14159267.
    rtype

    float

Remove()
  • Erases <ahowmany> characters from position <where>, <where> included. Example: aString contains ‘Hello’ aString.Erase(2,2) erases 2 characters from position 1 This gives ‘Hlo’.
    param where

    type where

    int

    param ahowmany

    default value is 1

    type ahowmany

    int

    rtype

    None

RemoveAll()
  • Remove all the occurences of the character C in the string Example: before me = ‘HellLLo’, C = ‘L’ , CaseSensitive = True after me = ‘Hello’
    param C

    type C

    Standard_Character

    param CaseSensitive

    type CaseSensitive

    bool

    rtype

    None* Removes every <what> characters from <self>

    param what

    type what

    Standard_Character

    rtype

    None

RightAdjust()
  • Removes all space characters at the end of the string.
    rtype

    None

RightJustify()
  • Right justify. Length becomes equal to Width and the new characters are equal to Filler if Width < Length nothing happens Raises an exception if Width is less than zero Example: before me = ‘abcdef’ , Width = 9 , Filler = ‘ ‘ after me = ‘ abcdef’
    param Width

    type Width

    int

    param Filler

    type Filler

    Standard_Character

    rtype

    None

Search()
  • Searches a CString in <self> from the beginning and returns position of first item <what> matching. It returns -1 if not found. Example: aString contains ‘Sample single test’ aString.Search(‘le’) returns 5
    param what

    type what

    char *

    rtype

    int* Searches a String in <self> from the beginning and returns position of first item <what> matching. it returns -1 if not found.

    param what

    type what

    TCollection_HAsciiString

    rtype

    int

SearchFromEnd()
  • Searches a CString in a String from the end and returns position of first item <what> matching. It returns -1 if not found. Example: aString contains ‘Sample single test’ aString.SearchFromEnd(‘le’) returns 12
    param what

    type what

    char *

    rtype

    int* Searches a HAsciiString in another HAsciiString from the end and returns position of first item <what> matching. It returns -1 if not found.

    param what

    type what

    TCollection_HAsciiString

    rtype

    int

SetValue()
  • Replaces one character in the string at position <where>. If <where> is less than zero or greater than the length of <self> an exception is raised. Example: aString contains ‘Garbake’ astring.Replace(6,’g’) gives <self> = ‘Garbage’
    param where

    type where

    int

    param what

    type what

    Standard_Character

    rtype

    None* Replaces a part of <self> in the string at position <where>. If <where> is less than zero or greater than the length of <self> an exception is raised. Example: aString contains ‘Garbake’ astring.Replace(6,’g’) gives <self> = ‘Garbage’

    param where

    type where

    int

    param what

    type what

    char *

    rtype

    None* Replaces a part of <self> by another string.

    param where

    type where

    int

    param what

    type what

    TCollection_HAsciiString

    rtype

    None

Split()
  • Splits a HAsciiString into two sub-strings. Example: aString contains ‘abcdefg’ aString.Split(3) gives <self> = ‘abc’ and returns ‘defg’
    param where

    type where

    int

    rtype

    opencascade::handle<TCollection_HAsciiString>

String()
  • Returns the field myString.
    rtype

    TCollection_AsciiString

SubString()
  • Creation of a sub-string of the string <self>. The sub-string starts to the index Fromindex and ends to the index ToIndex. Raises an exception if ToIndex or FromIndex is out of bounds Example: before me = ‘abcdefg’, ToIndex=3, FromIndex=6 after me = ‘abcdefg’ returns ‘cdef’
    param FromIndex

    type FromIndex

    int

    param ToIndex

    type ToIndex

    int

    rtype

    opencascade::handle<TCollection_HAsciiString>

ToCString()
  • Returns pointer to string (char *) This is useful for some casual manipulations Because this ‘char *’ is ‘const’, you can’t modify its contents.
    rtype

    char *

Token()
  • Extracts <whichone> token from <self>. By default, the <separators> is set to space and tabulation. By default, the token extracted is the first one (whichone = 1). <separators> contains all separators you need. If no token indexed by <whichone> is found, it returns an empty String. Example: aString contains ‘This is a message’ aString.Token() returns ‘This’ aString.Token(‘ ‘,4) returns ‘message’ aString.Token(‘ ‘,2) returns ‘is’ aString.Token(‘ ‘,9) returns ‘’ Other separators than space character and tabulation are allowed aString contains ‘1234; test:message , value’ aString.Token(‘; :,’,4) returns ‘value’ aString.Token(‘; :,’,2) returns ‘test’
    param separators

    default value is ‘ ‘

    type separators

    char *

    param whichone

    default value is 1

    type whichone

    int

    rtype

    opencascade::handle<TCollection_HAsciiString>

Trunc()
  • Truncates <self> to <ahowmany> characters. Example: me = ‘Hello Dolly’ -> Trunc(3) -> me = ‘Hel’
    param ahowmany

    type ahowmany

    int

    rtype

    None

UpperCase()
  • Converts <self> to its upper-case equivalent.
    rtype

    None

UsefullLength()
  • Length of the string ignoring all spaces (‘ ‘) and the control character at the end.
    rtype

    int

Value()
  • Returns character at position <where> in <self>. If <where> is less than zero or greater than the lenght of <self>, an exception is raised. Example: aString contains ‘Hello’ aString.Value(2) returns ‘e’
    param where

    type where

    int

    rtype

    Standard_Character

property thisown

The membership flag

class TCollection_HExtendedString(*args)

Bases: OCC.Core.Standard.Standard_Transient

  • Initializes a HExtendedString to an empty ExtendedString.
    rtype

    None* Initializes a HExtendedString with a CString.

    param message

    type message

    char *

    rtype

    None* Initializes a HExtendedString with an ExtString.

    param message

    type message

    Standard_ExtString

    rtype

    None* Initializes a HExtendedString with a single character.

    param aChar

    type aChar

    Standard_ExtCharacter

    rtype

    None* Initializes a HExtendedString with <length> space allocated. and filled with <filler>.This is usefull for buffers.

    param length

    type length

    int

    param filler

    type filler

    Standard_ExtCharacter

    rtype

    None* Initializes a HExtendedString with a HExtendedString.

    param aString

    type aString

    TCollection_ExtendedString

    rtype

    None* Initializes a HExtendedString with an HAsciiString.

    param aString

    type aString

    TCollection_HAsciiString

    rtype

    None* Initializes a HExtendedString with a HExtendedString.

    param aString

    type aString

    TCollection_HExtendedString

    rtype

    None

AssignCat()
  • Appends <other> to me.
    param other

    type other

    TCollection_HExtendedString

    rtype

    None

Cat()
  • Returns a string appending <other> to me.
    param other

    type other

    TCollection_HExtendedString

    rtype

    opencascade::handle<TCollection_HExtendedString>

ChangeAll()
  • Substitutes all the characters equal to aChar by NewChar in the string <self>.
    param aChar

    type aChar

    Standard_ExtCharacter

    param NewChar

    type NewChar

    Standard_ExtCharacter

    rtype

    None

Clear()
  • Removes all characters contained in <self>. This produces an empty ExtendedString.
    rtype

    None

static DownCast(t)
Insert()
  • Insert a ExtCharacter at position <where>. Example: aString contains ‘hy not ?’ aString.Insert(1,’W’); gives ‘Why not ?’ aString contains ‘Wh’ aString.Insert(3,’y’); gives ‘Why’ aString contains ‘Way’ aString.Insert(2,’h’); gives ‘Why’
    param where

    type where

    int

    param what

    type what

    Standard_ExtCharacter

    rtype

    None* Insert a HExtendedString at position <where>.

    param where

    type where

    int

    param what

    type what

    TCollection_HExtendedString

    rtype

    None

IsAscii()
  • Returns True if the string contains only ‘Ascii Range’ characters
    rtype

    bool

IsEmpty()
  • Returns True if the string <self> contains zero character
    rtype

    bool

IsGreater()
  • Returns True if <self> is greater than <other>.
    param other

    type other

    TCollection_HExtendedString

    rtype

    bool

IsLess()
  • Returns True if <self> is less than <other>.
    param other

    type other

    TCollection_HExtendedString

    rtype

    bool

IsSameState()
Parameters

other

type other

TCollection_HExtendedString

rtype

bool

Length()
  • Returns number of characters in <self>. This is the same functionality as ‘strlen’ in C.
    rtype

    int

PrintToString(TCollection_HExtendedString self) → std::string
Remove()
  • Erases <ahowmany> characters from position <where>, <where> included. Example: aString contains ‘Hello’ aString.Erase(2,2) erases 2 characters from position 1 This gives ‘Hlo’.
    param where

    type where

    int

    param ahowmany

    default value is 1

    type ahowmany

    int

    rtype

    None

RemoveAll()
  • Removes every <what> characters from <self>.
    param what

    type what

    Standard_ExtCharacter

    rtype

    None

Search()
  • Searches a String in <self> from the beginning and returns position of first item <what> matching. It returns -1 if not found.
    param what

    type what

    TCollection_HExtendedString

    rtype

    int

SearchFromEnd()
  • Searches a ExtendedString in another ExtendedString from the end and returns position of first item <what> matching. It returns -1 if not found.
    param what

    type what

    TCollection_HExtendedString

    rtype

    int

SetValue()
  • Replaces one character in the string at position <where>. If <where> is less than zero or greater than the length of <self> an exception is raised. Example: aString contains ‘Garbake’ astring.Replace(6,’g’) gives <self> = ‘Garbage’
    param where

    type where

    int

    param what

    type what

    Standard_ExtCharacter

    rtype

    None* Replaces a part of <self> by another string.

    param where

    type where

    int

    param what

    type what

    TCollection_HExtendedString

    rtype

    None

Split()
  • Splits a ExtendedString into two sub-strings. Example: aString contains ‘abcdefg’ aString.Split(3) gives <self> = ‘abc’ and returns ‘defg’
    param where

    type where

    int

    rtype

    opencascade::handle<TCollection_HExtendedString>

String()
  • Returns the field myString
    rtype

    TCollection_ExtendedString

ToExtString()
  • Returns pointer to ExtString
    rtype

    Standard_ExtString

Token()
  • Extracts <whichone> token from <self>. By default, the <separators> is set to space and tabulation. By default, the token extracted is the first one (whichone = 1). <separators> contains all separators you need. If no token indexed by <whichone> is found, it returns an empty String. Example: aString contains ‘This is a message’ aString.Token() returns ‘This’ aString.Token(‘ ‘,4) returns ‘message’ aString.Token(‘ ‘,2) returns ‘is’ aString.Token(‘ ‘,9) returns ‘’ Other separators than space character and tabulation are allowed aString contains ‘1234; test:message , value’ aString.Token(‘; :,’,4) returns ‘value’ aString.Token(‘; :,’,2) returns ‘test’
    param separators

    type separators

    Standard_ExtString

    param whichone

    default value is 1

    type whichone

    int

    rtype

    opencascade::handle<TCollection_HExtendedString>

Trunc()
  • Truncates <self> to <ahowmany> characters. Example: me = ‘Hello Dolly’ -> Trunc(3) -> me = ‘Hel’
    param ahowmany

    type ahowmany

    int

    rtype

    None

Value()
  • Returns ExtCharacter at position <where> in <self>. If <where> is less than zero or greater than the length of <self>, an exception is raised. Example: aString contains ‘Hello’ aString.Value(2) returns ‘e’
    param where

    type where

    int

    rtype

    Standard_ExtCharacter

property thisown

The membership flag

class TCollection_MapNode(*args)

Bases: OCC.Core.Standard.Standard_Transient

Parameters

n

type n

TCollection_MapNodePtr

rtype

None

static DownCast(t)
Next()
Return type

TCollection_MapNodePtr

property thisown

The membership flag

class TCollection_SeqNode(*args)

Bases: OCC.Core.Standard.Standard_Transient

Parameters

n

type n

TCollection_SeqNodePtr

param p

type p

TCollection_SeqNodePtr

rtype

None

static DownCast(t)
Next()
Return type

TCollection_SeqNodePtr

Previous()
Return type

TCollection_SeqNodePtr

property thisown

The membership flag

class tcollection

Bases: object

static NextPrimeForMap()
  • Returns a prime number greater than <I> suitable to dimension a Map. When <I> becomes great there is a limit on the result (today the limit is around 1 000 000). This is not a limit of the number of items but a limit in the number of buckets. i.e. there will be more collisions in the map.
    param I

    type I

    int

    rtype

    int

property thisown

The membership flag