OCC Main Page | DataExchange | Toolkits | Packages | Class Hierarchy | Data Structures | File List | Data Fields | Globals

# DataExchange
TKXSBase
Interface

# Interface_LineBuffer Class Reference

Simple Management of a Line Buffer, to be used by Interface
File Writers.
While a String is suitable to do that, this class ensures an
optimised Memory Management, because this is a hard point of
File Writing.
.

`#include <Interface_LineBuffer.hxx>`

## Public Member Functions
void * | operator new (size_t, void *anAddress)
void * | operator new (size_t size)
void | operator delete (void *anAddress)
Standard_EXPORT | Interface_LineBuffer (const Standard_Integer size=10)
| Creates a LineBuffer with an absolute maximum size (Default value is only to satisfy compiler requirement) .
Standard_EXPORT void | SetMax (const Standard_Integer max)
| Changes Maximum allowed size of Buffer. If <max> is Zero, Maximum size is set to the initial size. .
Standard_EXPORT void | SetInitial (const Standard_Integer initial)
| Sets an Initial reservation for Blank characters (this reservation is counted in the size of the current Line) .
Standard_EXPORT void | SetKeep ()
| Sets a Keep Status at current Length. It means that at next Move, the new line will begin by characters between Keep + 1 and current Length .
Standard_EXPORT Standard_Boolean | CanGet (const Standard_Integer more)
| Returns True if there is room enough to add <more> characters Else, it is required to Dump the Buffer before refilling it <more> is recorded to manage SetKeep status .
Standard_EXPORT Standard_CString | Content () const
| Returns the Content of the LineBuffer was C++ : return const .
Standard_EXPORT Standard_Integer | Length () const
| Returns the Length of the LineBuffer .
Standard_EXPORT void | Clear ()
| Clears completely the LineBuffer .
Standard_EXPORT void | FreezeInitial ()
| Inhibits effect of SetInitial until the next Move (i.e. Keep) Then Prepare will not insert initial blanks, but further ones will. This allows to cancel initial blanks on an internal Split A call to SetInitial has no effect on this until Move .
Standard_EXPORT void | Move (TCollection_AsciiString &str)
| Fills a AsciiString <str> with the Content of the Line Buffer, then Clears the LineBuffer .
Standard_EXPORT void | Move (const Handle(TCollection_HAsciiString)&str)
| Same as above, but <str> is known through a Handle .
Standard_EXPORT Handle_TCollection_HAsciiString | Moved ()
| Same as above, but generates the HAsciiString .
Standard_EXPORT void | Add (const Standard_CString text)
| Adds a text as a CString. Its Length is evaluated from the text (by C function strlen) .
Standard_EXPORT void | Add (const Standard_CString text, const Standard_Integer lntext)
| Adds a text as a CString. Its length is given as <lntext> .
Standard_EXPORT void | Add (const TCollection_AsciiString &text)
| Adds a text as a AsciiString from TCollection .
Standard_EXPORT void | Add (const Standard_Character text)
| Adds a text made of only ONE Character .
## Private Member Functions
Standard_EXPORT void | Prepare ()
| Prepares Move : Inserts Initial Blanks if required, and determines if SetKeep can be supported (it cannot be if Length + Next String to get (see CanGet) overpass Max Size) .
Standard_EXPORT void | Keep ()
| Keeps characters from SetKeep. If SetKeep is Zero, equivalent to Clear .
## Private Attributes
TCollection_AsciiString | theline
Standard_Integer | themax
Standard_Integer | theinit
Standard_Integer | thekeep
Standard_Integer | theget
Standard_Integer | thelen
Standard_Integer | thefriz
Standard_Character | thekept

## Constructor & Destructor Documentation

Standard_EXPORT Interface_LineBuffer::Interface_LineBuffer | ( | const Standard_Integer | size = `10` | ) |

## Member Function Documentation

Standard_EXPORT void Interface_LineBuffer::Add | ( | const Standard_Character | text | ) |

Standard_EXPORT void Interface_LineBuffer::Add | ( | const TCollection_AsciiString & | text | ) |

Standard_EXPORT void Interface_LineBuffer::Add | ( | const Standard_CString | text,
|  | const Standard_Integer | lntext
| ) |

Standard_EXPORT void Interface_LineBuffer::Add | ( | const Standard_CString | text | ) |

Standard_EXPORT Standard_Boolean Interface_LineBuffer::CanGet | ( | const Standard_Integer | more | ) |

Standard_EXPORT void Interface_LineBuffer::Clear | ( |  | ) |

Standard_EXPORT Standard_CString Interface_LineBuffer::Content | ( |  | ) | const

Standard_EXPORT void Interface_LineBuffer::FreezeInitial | ( |  | ) |

Standard_EXPORT void Interface_LineBuffer::Keep | ( |  | ) | `[private]`

Standard_EXPORT Standard_Integer Interface_LineBuffer::Length | ( |  | ) | const

Standard_EXPORT void Interface_LineBuffer::Move | ( | const Handle(TCollection_HAsciiString)& | str | ) |

Standard_EXPORT void Interface_LineBuffer::Move | ( | TCollection_AsciiString & | str | ) |

Standard_EXPORT Handle_TCollection_HAsciiString Interface_LineBuffer::Moved | ( |  | ) |

void Interface_LineBuffer::operator delete | ( | void * | anAddress | ) | `[inline]`

void* Interface_LineBuffer::operator new | ( | size_t | size | ) | `[inline]`

void* Interface_LineBuffer::operator new | ( | size_t | ,
|  | void * | anAddress
| ) | `[inline]`

Standard_EXPORT void Interface_LineBuffer::Prepare | ( |  | ) | `[private]`

Standard_EXPORT void Interface_LineBuffer::SetInitial | ( | const Standard_Integer | initial | ) |

Standard_EXPORT void Interface_LineBuffer::SetKeep | ( |  | ) |

Standard_EXPORT void Interface_LineBuffer::SetMax | ( | const Standard_Integer | max | ) |

## Field Documentation

Standard_Integer Interface_LineBuffer::thefriz`[private]`

Standard_Integer Interface_LineBuffer::theget`[private]`

Standard_Integer Interface_LineBuffer::theinit`[private]`

Standard_Integer Interface_LineBuffer::thekeep`[private]`

Standard_Character Interface_LineBuffer::thekept`[private]`

Standard_Integer Interface_LineBuffer::thelen`[private]`

TCollection_AsciiString Interface_LineBuffer::theline`[private]`

Standard_Integer Interface_LineBuffer::themax`[private]`

The documentation for this class was generated from the following file:

- Interface_LineBuffer.hxx