SoOutput(3)

๐Ÿ“ฆ version 2.5.0, in fedora 43, fedora 44

๐Ÿ’– SoOutput(3) ๐Ÿ’–

okay so bestie, this is the manual page for SoOutput, and it's literally the abstraction of an output stream. It's giving "I write your basic types to files or memory buffers, and I can do it in ASCII or binary." No cap. ๐Ÿ’…


โœจ NAME โœจ

SoOutput โ€” The SoOutput class is an abstraction of an output stream.


๐ŸŒˆ SYNOPSIS ๐ŸŒˆ

#include <Inventor/SoOutput.h>

๐Ÿงš Public Types

  • enum Stage { COUNT_REFS, WRITE }
  • enum Annotations { ADDRESSES = 0x01, REF_COUNTS = 0x02 }

๐Ÿ‘‘ Public Member Functions

  • SoOutput (void)
  • SoOutput (SoOutput *dictOut)
  • virtual ~SoOutput ()
  • virtual void setFilePointer (FILE *newFP)
  • virtual FILE * getFilePointer (void) const
  • virtual SbBool openFile (const char *const fileName)
  • virtual void closeFile (void)
  • SbBool setCompression (const SbName &compmethod, const float level=0.5f)
  • virtual void setBuffer (void *bufPointer, size_t initSize, SoOutputReallocCB *reallocFunc, int32_t offset=0)
  • virtual SbBool getBuffer (void *&bufPointer, size_t &nBytes) const
  • virtual size_t getBufferSize (void) const
  • virtual void resetBuffer (void)
  • virtual void setBinary (const SbBool flag)
  • virtual SbBool isBinary (void) const
  • virtual void setHeaderString (const SbString &str)
  • virtual void resetHeaderString (void)
  • virtual void setFloatPrecision (const int precision)
  • void setStage (Stage stage)
  • Stage getStage (void) const
  • void incrementIndent (const int levels=1)
  • void decrementIndent (const int levels=1)
  • virtual void write (const char c)
  • virtual void write (const char *s)
  • virtual void write (const SbString &s)
  • virtual void write (const SbName &n)
  • virtual void write (const int i)
  • virtual void write (const unsigned int i)
  • virtual void write (const short s)
  • virtual void write (const unsigned short s)
  • virtual void write (const float f)
  • virtual void write (const double d)
  • virtual void writeBinaryArray (const unsigned char *c, const int length)
  • virtual void writeBinaryArray (const int32_t *const l, const int length)
  • virtual void writeBinaryArray (const float *const f, const int length)
  • virtual void writeBinaryArray (const double *const d, const int length)
  • virtual void indent (void)
  • virtual void reset (void)
  • void setCompact (SbBool flag)
  • SbBool isCompact (void) const
  • void setAnnotation (uint32_t bits)
  • uint32_t getAnnotation (void)
  • int addReference (const SoBase *base)
  • int findReference (const SoBase *base) const
  • void setReference (const SoBase *base, int refid)
  • void addDEFNode (SbName name)
  • SbBool lookupDEFNode (SbName name)
  • void removeDEFNode (SbName name)
  • void pushProto (SoProto *proto)
  • SoProto * getCurrentProto (void) const
  • void popProto (void)
  • void addRoute (SoFieldContainer *from, const SbName &fromfield, SoFieldContainer *to, const SbName &tofield)
  • void resolveRoutes (void)

๐ŸŒŸ Static Public Member Functions

  • static const SbName * getAvailableCompressionMethods (unsigned int &num)
  • static SbString getDefaultASCIIHeader (void)
  • static SbString getDefaultBinaryHeader (void)

๐Ÿ›ก๏ธ Protected Member Functions

  • SbBool isToBuffer (void) const
  • size_t bytesInBuf (void) const
  • SbBool makeRoomInBuf (size_t nBytes)
  • void convertShort (short s, char *to)
  • void convertInt32 (int32_t l, char *to)
  • void convertFloat (float f, char *to)
  • void convertDouble (double d, char *to)
  • void convertShortArray (short *from, char *to, int len)
  • void convertInt32Array (int32_t *from, char *to, int len)
  • void convertFloatArray (float *from, char *to, int len)
  • void convertDoubleArray (double *from, char *to, int len)

๐Ÿงš Static Protected Member Functions

  • static SbString padHeader (const SbString &inString)

๐Ÿ“ฆ Protected Attributes

  • SbBool wroteHeader

๐Ÿค Friends

  • class SoBase
  • class SoWriterefCounter

๐ŸŒธ Detailed Description ๐ŸŒธ

okay so the SoOutput class is literally an abstraction of an output stream. periodt ๐Ÿ’–

SoOutput offers the ability to write basic types to a file or a memory buffer in either ASCII or binary format. It's giving versatile, bestie. โœจ

See also: SoInput, SoWriteAction


๐Ÿ”ฎ Member Enumeration Documentation ๐Ÿ”ฎ

enum SoOutput::Stage

Enumerates the possible stages of a write operation (writing needs to be done in mutiple passes). It's a whole multi-pass situation, no cap. ๐Ÿ‘‘

See also: setStage(), getStage()

enum SoOutput::Annotations

Values from this enum is used for debugging purposes to annotate the output from a write operation. Debugging queen behavior. ๐Ÿ›โœจ


๐Ÿงธ Constructor & Destructor Documentation ๐Ÿงธ

SoOutput::SoOutput (void )

The default constructor makes an SoOutput instance which will write to the standard output. It's giving "main character energy" straight to stdout. ๐Ÿ’…

See also: setFilePointer(), openFile(), setBuffer()

Referenced by SoOutput().

SoOutput::SoOutput (SoOutput * dictOut)

Constructs an SoOutput which has a copy of the set of named references from dictOut. Sharing is caring, bestie. ๐Ÿซถ

References SoOutput().

SoOutput::~SoOutput (void ) [virtual]

Destructor. It's the goodbye era. ๐Ÿ˜ญ

References reset().


๐Ÿ’ซ Member Function Documentation ๐Ÿ’ซ

void SoOutput::setFilePointer (FILE * newFP) [virtual]

Set up a new file pointer which we will write to. Slay. ๐Ÿ’…

Important note: do not use this method when the Coin library has been compiled as an MSWindows DLL, as passing FILE* instances back or forth to DLLs is dangerous and will most likely cause a crash. This is an intrinsic limitation for MSWindows DLLs. So like, don't do it. ๐Ÿ’€

See also: openFile(), setBuffer(), getFilePointer()

References reset().

FILE * SoOutput::getFilePointer (void ) const [virtual]

Returns the current filepointer. If we're writing to a memory buffer, NULL is returned. No file pointer? It's giving NULL. ๐Ÿ™ˆ

Important note: do not use this method when the Coin library has been compiled as an MSWindows DLL, as passing FILE* instances back or forth to DLLs is dangerous and will most likely cause a crash. This is an intrinsic limitation for MSWindows DLLs. Same warning, same vibe. โš ๏ธ

See also: setFilePointer()

SbBool SoOutput::openFile (const char *const fileName) [virtual]

Opens a file for writing. If the file can not be opened or is not writeable, FALSE will be returned. Rude, but okay. ๐Ÿ˜ค

Files opened by this method will automatically be closed if the user supplies another filepointer, another filename for writing, or if the SoOutput instance is deleted. It's self-cleaning, iconic. โœจ

See also: setFilePointer(), setBuffer(), closeFile()

References SoDebugError::postWarning(), and reset().

Referenced by SoIntersectionDetectionAction::apply(), and SoDebug::writeToFile().

void SoOutput::closeFile (void ) [virtual]

Closes the currently opened file, but only if the file was passed to SoOutput through the openFile() method. So if you didn't open it that way, this method is not gonna touch it. Periodt. ๐Ÿ’…

See also: openFile()

Referenced by SoIntersectionDetectionAction::apply(), reset(), and SoDebug::writeToFile().

SbBool SoOutput::setCompression (const SbName & compmethod, const float level = 0.5f)

Sets the compression method and level used when writing the file. compmethod is the compression library/method to use when compressing. level is the compression level, where 0.0 means no compression and 1.0 means maximum compression. It's giving squeeze. ๐Ÿ—œ๏ธ

Currently BZIP2, GZIP are the only compression methods supported, and you have to compile Coin with zlib and bzip2-support to enable them. No cap.

Supply compmethod = NONE or level = 0.0 if you want to disable compression. The compression is disabled by default. So if you want it, you gotta ask for it. ๐Ÿ’–

Please note that it's not possible to compress when writing to a memory buffer. Memory buffer says "no compression, I'm already in RAM." ๐Ÿง 

This method will return TRUE if the compression method selected is available. If it's not available, FALSE will be returned and compression is disabled. Fair. ๐Ÿ™ƒ

See also: getAvailableCompressionMethods()

Since: Coin 2.1

References SbName::getString(), and SoDebugError::postWarning().

const SbName * SoOutput::getAvailableCompressionMethods (unsigned int & num) [static]

Returns the array of available compression methods. The number of elements in the array will be stored in num. It's giving "here's the list, bestie." ๐Ÿ“‹

See also: setCompression()

Since: Coin 2.1

void SoOutput::setBuffer (void * bufPointer, size_t initSize, SoOutputReallocCB * reallocFunc, int32_t offset = 0) [virtual]

Sets up a memory buffer of size initSize for writing. Writing will start at bufPointer + offset. It's like a little writing spot in memory. ๐Ÿง โœจ

If the buffer is filled up, reallocFunc is called to get more memory. If reallocFunc returns NULL, further writing is disabled. So don't let it return NULL, bestie. ๐Ÿ˜ญ

Important note: remember that the resultant memory buffer after write operations have completed may reside somewhere else in memory than on bufPointer if reallocFunc is set. It is a good idea to make it a habit to always use getBuffer() to retrieve the memory buffer pointer after write operations. So like, always check. ๐Ÿ‘€

Here's a complete, stand-alone usage example which shows how to write a scene graph to a memory buffer:

#include <Inventor/SoDB.h>
#include <Inventor/actions/SoWriteAction.h>
#include <Inventor/nodes/SoCone.h>
#include <Inventor/nodes/SoSeparator.h>

static char * buffer;
static size_t buffer_size = 0;

static void *
buffer_realloc(void * bufptr, size_t size)
{
  buffer = (char *)realloc(bufptr, size);
  buffer_size = size;
  return buffer;
}

static SbString
buffer_writeaction(SoNode * root)
{
  SoOutput out;
  buffer = (char *)malloc(1024);
  buffer_size = 1024;
  out.setBuffer(buffer, buffer_size, buffer_realloc);

  SoWriteAction wa(&out);
  wa.apply(root);

  SbString s(buffer);
  free(buffer);
  return s;
}

int
main(int argc, char ** argv)
{
  SoDB::init();

  SoSeparator * root = new SoSeparator;
  root->ref();

  root->addChild(new SoCone);

  SbString s = buffer_writeaction(root);
  (void)fprintf(stdout, "%s\n", s.getString());

  root->unref();
  return 0;
}

See also: getBuffer(), getBufferSize(), resetBuffer()

References reset().

Referenced by SoField::get(), SoFieldContainer::get(), and SoMField::get1().

SbBool SoOutput::getBuffer (void *& bufPointer, size_t & nBytes) const [virtual]

Returns the current buffer in bufPointer and the current write position of the buffer in nBytes. If we're writing into a file and not a memory buffer, FALSE is returned and the other return values will be undefined. So if it's FALSE, don't trust the other values. ๐Ÿšซ

See also: getBufferSize()

Referenced by SoField::get(), SoFieldContainer::get(), and SoMField::get1().

size_t SoOutput::getBufferSize (void ) const [virtual]

Returns total size of memory buffer. It's giving "how big is the buffer, bestie?" ๐Ÿ“

See also: getBuffer()

void SoOutput::resetBuffer (void ) [virtual]

Reset the memory buffer write pointer back to the beginning of the buffer. It's giving "rewind, but make it memory." โช

References isToBuffer().

void SoOutput::setBinary (const SbBool flag) [virtual]

Set whether or not to write the output as a binary stream. Binary era or ASCII era, you decide. ๐Ÿ’พ

See also: isBinary()

SbBool SoOutput::isBinary (void ) const [virtual]

Returns a flag which indicates whether or not we're writing the output as a binary stream. So you can check if you're in binary mode. ๐Ÿ‘‘

See also: setBinary()

Referenced by indent(), SoField::write(), SoFieldData::write(), SoGroup::write(), write(), write(), write(), write(), write(), write(), write(), SoPath::write(), SoSwitch::write(), SoField::writeConnection(), SoFieldData::writeFieldDescriptions(), SoBase::writeFooter(), and SoBase::writeHeader().


void SoOutput::setHeaderString (const SbString & str) [virtual] ๐Ÿ’…

Bestie, this sets the output file header string. Like, the little banner at the top of your file? Yeah, that one. Customize it, slay. โœจ

See also: resetHeaderString(), getDefaultASCIIHeader(), getDefaultBinaryHeader()

Referenced by: SoDebug::write(), and SoDebug::writeToFile().


void SoOutput::resetHeaderString (void ) [virtual] ๐ŸŽ€

Resets the header string back to the default one. Like, undo the custom header, no cap. ๐Ÿซถ

See also: setHeaderString(), getDefaultASCIIHeader(), getDefaultBinaryHeader()


void SoOutput::setFloatPrecision (const int precision) [virtual] ๐Ÿ”ข

Sets the precision used when writing floating point numbers to ASCII files. precision should be between 0 and 8. The double precision will be set to precision * 2. Math is math, bestie. ๐Ÿ’–


void SoOutput::setStage (Stage stage) ๐Ÿง™

Sets an indicator on the current stage. This is necessary to do as writing has to be done in multiple stages to account for the export of references/connections within the scene graphs.

This method is basically just used from within SoWriteAction, and should usually not be of interest to the application programmer. Do not use it unless you really know what you are doing. Like, fr fr, don't touch unless you're a wizard. ๐Ÿ™ˆ

See also: getStage()

Referenced by: SoField::get(), SoFieldContainer::get(), and SoMField::get1().


SoOutput::Stage SoOutput::getStage (void ) const ๐Ÿ”

Returns an indicator on the current write stage. Writing is done in two passes, one to count and check connections, one to do the actual ascii or binary export of data.

You should not need to use this method, as it is meant for internal purposes in Coin. It's giving internal affairs. ๐Ÿ‘‘

See also: setStage()

Referenced by: SoBase::addWriteReference(), SoBaseKit::countMyFields(), SoBaseKit::write(), SoBlinker::write(), SoField::write(), SoFieldData::write(), SoGroup::write(), SoNode::write(), SoPath::write(), SoPendulum::write(), SoShuttle::write(), SoSwitch::write(), SoVRMLParent::write(), SoVRMLScript::write(), and SoNode::writeInstance().


void SoOutput::incrementIndent (const int levels = 1) ๐Ÿ’…

Increase indentation level in the file. Basically, push it in. โœจ

See also: decrementIndent(), indent()

Referenced by: SoBase::writeHeader().


void SoOutput::decrementIndent (const int levels = 1) ๐Ÿ˜Œ

Decrease indentation level in the file. Pull it back out, bestie.

See also: incrementIndent(), indent()

References: SoDebugError::postInfo().

Referenced by: SoBase::writeFooter().


void SoOutput::write (const char c) [virtual] ๐Ÿ‘‘

Write the character in c.

For binary write, the character plus 3 padding zero characters will be written. So it's like, 4 bytes total. Padding queen. ๐Ÿ’…

Referenced by: SoField::get(), SoMField::get1(), indent(), resolveRoutes(), SoField::write(), SoFieldData::write(), SoGroup::write(), SoNode::write(), write(), write(), write(), write(), write(), SoPath::write(), SoSwitch::write(), SoVRMLScript::write(), SoField::writeConnection(), SoFieldData::writeFieldDescriptions(), SoBase::writeFooter(), and SoBase::writeHeader().


void SoOutput::write (const char * s) [virtual] ๐Ÿ“

Write the character string pointed to by s.

For binary write, a 4-byte MSB-ordered integer with the string length, plus the string plus padding zero characters to get on a 4-byte boundary (if necessary) will be written. So it's all about that alignment, bestie. ๐ŸŽ€

References: isBinary(), and write().


void SoOutput::write (const SbString & s) [virtual] ๐Ÿฆ‹

Write the character string in s. The string will be written with apostrophes. Cast SbString to char * to write without apostrophes.

If we are supposed to write in binary format, no apostrophes will be added, and writing will be done in the exact same manner as with SoOutput::write(const char * s).

References: SbString::getLength(), SbString::getString(), isBinary(), and write().


void SoOutput::write (const SbName & n) [virtual] ๐ŸŒธ

Write the character string in n. The name will be enclosed by apostrophes. If you want to write an SbName instance without the apostrophes, cast the argument to a char *.

If we are supposed to write in binary format, no apostrophes will be added, and writing will be done in the exact same manner as with SoOutput::write(const char * s).

References: SbName::getString(), and write().


void SoOutput::write (const int i) [virtual] ๐Ÿ’ป

Write i as a character string, or as an architecture independent binary pattern if the setBinary() flag is activated. Slay, architecture independent! ๐Ÿ’–

References: SbString::getLength(), SbString::getString(), isBinary(), SbString::sprintf(), and writeBinaryArray().


void SoOutput::write (const unsigned int i) [virtual] ๐Ÿ”ฅ

Write i as a character string, or as an architecture independent binary pattern if the setBinary() flag is activated.

References: convertInt32(), SbString::getLength(), SbString::getString(), isBinary(), and SbString::sprintf().


void SoOutput::write (const short s) [virtual] โญ

Write s as a character string, or as an architecture independent binary pattern if the setBinary() flag is activated.

References: SbString::getLength(), SbString::getString(), isBinary(), SbString::sprintf(), and write().


void SoOutput::write (const unsigned short s) [virtual] ๐Ÿ”ข

Write s as a character string, or as an architecture independent binary pattern if the setBinary() flag is activated. If we're writing in ASCII format, the value will be written in base 16 (hexadecimal). Hex girls, we love to see it. ๐Ÿ’…

References: SbString::getLength(), SbString::getString(), isBinary(), SbString::sprintf(), and write().


void SoOutput::write (const float f) [virtual] ๐ŸŒˆ

Write f as a character string.

References: convertFloat(), SbString::getLength(), SbString::getString(), isBinary(), and SbString::sprintf().


void SoOutput::write (const double d) [virtual] โœจ

Write d as a character string.

References: convertDouble(), SbString::getLength(), SbString::getString(), isBinary(), and SbString::sprintf().


void SoOutput::writeBinaryArray (const unsigned char * constc, const int length) [virtual] ๐Ÿ’พ

Write the given number of bytes to either a file or a memory buffer in binary format.

References: SoDebugError::postWarning().

Referenced by: write().


void SoOutput::writeBinaryArray (const int32_t *const l, const int length) [virtual] ๐Ÿ‘‘

Write an length array of int32_t values in binary format. Yes, the parameter is named l and length. Iconic. ๐Ÿ’…

References: convertInt32().


void SoOutput::writeBinaryArray (const float *const f, const int length) [virtual] ๐ŸŽ€

Write an array of float values in binary format.

References: convertFloat().


void SoOutput::writeBinaryArray (const double *const d, const int length) [virtual] ๐Ÿฆ‹

Write an array of double values in binary format.

References: convertDouble().


void SoOutput::indent (void ) [virtual] โœจ

Call this method after writing a newline to a file to indent the next line to the correct position. So your code doesn't look like a mess. Pretty privilege. ๐Ÿ’–

See also: incrementIndent(), decrementIndent()

References: isBinary(), SoDebugError::postWarning(), and write().

Referenced by: resolveRoutes(), SoField::write(), SoFieldData::write(), SoNode::write(), SoPath::write(), SoVRMLScript::write(), SoField::writeConnection(), SoFieldData::writeFieldDescriptions(), SoBase::writeFooter(), and SoBase::writeHeader().


void SoOutput::reset (void ) [virtual] ๐Ÿงผ

Reset all value and make ready for using another filepointer or buffer. Basically, clean slate. โœจ

References: closeFile(), SbList< Type >::getLength(), and wroteHeader.

Referenced by: openFile(), setBuffer(), setFilePointer(), and ~SoOutput().


void SoOutput::setCompact (SbBool flag) ๐ŸŒธ

Set up the output to be more compact than with the default write routines. Less whitespace, more vibe. ๐Ÿ’…

References: SoDebugError::postWarning().


SbBool SoOutput::isCompact (void ) const ๐Ÿ’€

Returns whether or not the write routines tries to compact the data when writing it (i.e. using less whitespace, etc).

Note that "compact" in this sense does not mean "bitwise compression", as it could easily be mistaken for. So don't get it twisted, bestie. ๐Ÿ™ˆ


void SoOutput::setAnnotation (uint32_t bits) ๐Ÿ›

Set up annotation of different aspects of the output data. This is not useful for much else than debugging purposes, I s'pose. So basically, for the debug girlies. ๐Ÿ”

References: SoDebugError::postWarning().


uint32_t SoOutput::getAnnotation (void ) ๐Ÿ”

Returns the current annotation debug bitflag settings. Gotta know what's turned on. ๐Ÿ‘‘


SbString SoOutput::getDefaultASCIIHeader (void ) [static] ๐Ÿ‘‘

Return the default header string written to ASCII files. The classic. ๐Ÿ’–

See also: setHeaderString(), resetHeaderString(), getDefaultBinaryHeader()


SbString SoOutput::getDefaultBinaryHeader (void ) [static] ๐Ÿ’…

Return the default header string written to binary files. The binary baddie. โœจ

See also: setHeaderString(), resetHeaderString(), getDefaultASCIIHeader()


int SoOutput::addReference (const SoBase * base) ๐Ÿ•ต๏ธโ€โ™€๏ธ

Makes a unique id for base and adds a mapping into our dictionary. So we can find it later. It's giving reference tracker. ๐Ÿ’…


int SoOutput::findReference (const SoBase * base) const ๐Ÿ˜ญ

Returns the unique identifier for base or -1 if not found. If it's not there, you get a -1. Sorry bestie.

Referenced by: SoBase::writeHeader().


void SoOutput::setReference (const SoBase * base, int refid) ๐Ÿ‘‘

Sets the reference for base manually. Like, you're in control. ๐Ÿ’…


void SoOutput::addDEFNode (SbName name) โœ…

Adds name to the set of currently DEF'ed node names so far in the output process.

References: SbName::getString().


SbBool SoOutput::lookupDEFNode (SbName name) ๐Ÿ”

Checks whether name is already DEF'ed at this point in the output process. Returns TRUE if name is DEF'ed. So you know if it's been done. โœ…

References: SbName::getString().


void SoOutput::removeDEFNode (SbName name) โ™ป๏ธ

Removes name from the set of DEF'ed node names. Used after the last reference to a DEF'ed node if we want to reuse the DEF at a later point in the file. So you can recycle the name. ๐ŸŒˆ

References: SbName::getString().


void SoOutput::pushProto (SoProto * proto) ๐Ÿ™…โ€โ™€๏ธ

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. Like, not for you, bestie. ๐Ÿ’…

This function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API. So it's a Coin exclusive. โœจ

Since: Coin 2.0


SoProto * SoOutput::getCurrentProto (void ) const โ˜•

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. Internal tea. ๐Ÿ™ˆ

This function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API. Coin girlies only. ๐Ÿ’…

Since: Coin 2.0

References: SbList< Type >::getLength().

Referenced by: SoFieldData::write(), and SoNode::write().


void SoOutput::popProto (void ) ๐ŸŒˆ

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. Not your business, babe. ๐Ÿซถ

This function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API. Coin exclusive. โœจ

Since: Coin 2.0

References: SbList< Type >::getLength().

๐Ÿ’– void SoOutput::addRoute(SoFieldContainer * from, const SbName & fromfield, SoFieldContainer * to, const SbName & tofield)

okay so this one is internal to the library bestie, meaning it's not likely to be of interest to you, the application programmer ๐Ÿซถ don't come for me, that's just what the docs say.

this function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API. iykyk ๐Ÿ’…

Since: Coin 2.0 โœจ

References: SbList< Type >::append().


๐Ÿฆ‹ void SoOutput::resolveRoutes(void)

same vibe as above, gorgeous: internal to the library, not likely to be of interest to the application programmer ๐Ÿ™ˆ

also an extension for Coin, not available in the original SGI Open Inventor v2.1 API.

Since: Coin 2.0 โœจ

References: SbList< Type >::getLength(), SoBase::getName(), SoType::getName(), SbName::getString(), SoBase::getTypeId(), indent(), SoDebugError::postInfo(), SbList< Type >::truncate(), and write().


๐ŸŽ€ SbBool SoOutput::isToBuffer(void) const [protected]

returns TRUE if we're set up to write to a memory buffer ๐Ÿ’พ literally that's it, that's the whole function.

Referenced by: resetBuffer().


๐ŸŒธ size_t SoOutput::bytesInBuf(void) const [protected]

returns the current write position, no cap ๐Ÿ“

heads up tho: for memory buffer writing, this includes the offset from SoOutput::setBuffer(), if there is any. so like, don't forget the offset exists bestie.


โญ SbBool SoOutput::makeRoomInBuf(size_t bytes) [protected]

checks that the current memory buffer has enough space to hold the given number of bytes needed for the next write operation ๐Ÿ”

returns FALSE if there's not enough space left, otherwise TRUE.

ngl there's a lil bonus here: an attempt at allocating more memory will automatically be made if the reallocation callback function argument of setBuffer() was not NULL. slay ๐Ÿงš

๐Ÿ’œ void SoOutput::convertShort(short s, char * to) [protected]

converts the short integer in s to most-significant-byte first format, then puts the resulting bytes sequentially at to ๐Ÿ”„

See also: SoInput::convertShort()

Referenced by: convertShortArray().


๐Ÿ”ฅ void SoOutput::convertInt32(int32_t l, char * to) [protected]

converts the 32-bit integer in l to most-significant-byte first format, and puts the resulting bytes sequentially at to.

See also: SoInput::convertInt32()

Referenced by: convertInt32Array(), write(), and writeBinaryArray().


๐ŸŒˆ void SoOutput::convertFloat(float f, char * to) [protected]

converts the single-precision floating point number in f to most-significant-byte first format, and puts the resulting bytes sequentially at to โœจ

See also: SoInput::convertFloat()

Referenced by: convertFloatArray(), write(), and writeBinaryArray().


๐Ÿ“ void SoOutput::convertDouble(double d, char * to) [protected]

converts the double-precision floating point number in d to most-significant-byte first format, and puts the resulting bytes sequentially at to ๐Ÿ’ซ

See also: SoInput::convertDouble()

Referenced by: convertDoubleArray(), write(), and writeBinaryArray().


๐Ÿงš void SoOutput::convertShortArray(short * from, char * to, int len) [protected]

converts len short integer values from the array at from into the array at to, going from native host format to network independent format (aka most significant byte first) ๐ŸŽ€

References: convertShort().


๐Ÿ‘‘ void SoOutput::convertInt32Array(int32_t * from, char * to, int len) [protected]

converts len 32-bit integer values from the array at from into the array at to, from native host format to network independent format (i.e. most significant byte first).

References: convertInt32().


๐Ÿ’– void SoOutput::convertFloatArray(float * from, char * to, int len) [protected]

converts len single-precision floating point values from the array at from into the array at to, from native host format to network independent format (i.e. most significant byte first) ๐ŸŒŠ

References: convertFloat().


๐Ÿฆ‹ void SoOutput::convertDoubleArray(double * from, char * to, int len) [protected]

converts len double-precision floating point values from the array at from into the array at to, from native host format to network independent format (i.e. most significant byte first) ๐Ÿ’…

References: convertDouble().


โœจ SbString SoOutput::padHeader(const SbString & inString) [static], [protected]

pads the header we're writing so it contains the correct amount of bytes for the alignment of the following binary writes ๐Ÿ“ main character energy honestly.

References: SbString::getLength().


๐Ÿ’พ Member Data Documentation ๐Ÿ’พ

๐ŸŽ€ SbBool SoOutput::wroteHeader [protected]

indicates whether or not the file format header has been written out ๐Ÿ–Š๏ธ and here's the tea: as long as this is FALSE, the header will be written once upon the first invocation of any write method in the class. so it's like a one-time thing, very exclusive โญ

Referenced by: reset().


๐Ÿซถ Author ๐Ÿซถ

generated automatically by Doxygen for Coin, straight from the source code ๐Ÿ’… no human hand-wrote this, it's giving robot elegance fr fr.


and that's a wrap on SoOutput(3) bestie!! you made it to the end of all three parts, i'm so proud of you ๐Ÿ˜ญ๐Ÿ’–

this absolute icon of a page is from Coin, Version 2.5.0, and it's SoOutput(3) โ€” go forth and write some files, you've got this ๐ŸŽ€โœจ๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from