HydraExpress™ C++ API Reference Guide

 
Loading...
Searching...
No Matches
rwsf::ServletOutputStream Class Reference

Output stream for writing a response. More...

#include <rwsf/servlet/ServletOutputStream.h>

Public Member Functions

virtual ~ServletOutputStream ()
std::string getBuffer () const
ServletOutputStream & print (bool b)
ServletOutputStream & print (char c)
ServletOutputStream & print (const char *s)
ServletOutputStream & print (const std::string &str)
ServletOutputStream & print (const unsigned char *s)
ServletOutputStream & print (double s)
ServletOutputStream & print (float s)
ServletOutputStream & print (int s)
ServletOutputStream & print (long long s)
ServletOutputStream & print (long s)
ServletOutputStream & print (short s)
ServletOutputStream & print (unsigned char uc)
ServletOutputStream & print (unsigned int s)
ServletOutputStream & print (unsigned long long s)
ServletOutputStream & print (unsigned long s)
ServletOutputStream & print (unsigned short s)
ServletOutputStream & println ()
ServletOutputStream & println (bool b)
ServletOutputStream & println (char c)
ServletOutputStream & println (const char *s)
ServletOutputStream & println (const std::string &str)
ServletOutputStream & println (const unsigned char *s)
ServletOutputStream & println (double s)
ServletOutputStream & println (float s)
ServletOutputStream & println (int s)
ServletOutputStream & println (long long s)
ServletOutputStream & println (long s)
ServletOutputStream & println (short s)
ServletOutputStream & println (unsigned char uc)
ServletOutputStream & println (unsigned int s)
ServletOutputStream & println (unsigned long long s)
ServletOutputStream & println (unsigned long s)
ServletOutputStream & println (unsigned short s)
void reset ()
void reset (const std::string &newContents)

Friends

class rwsf::ServletResponse

Detailed Description

rwsf::ServletOutputStream provides a simple mechanism for writing a response. The class has a set of print() and println() functions that duplicate the corresponding methods in the Java ServletOutputStream class. A print() method writes the argument to the output stream. A println() method writes the argument and a newline to the output stream.

Note
The print(bool) and println(bool) functions follow Java conventions and produce true and false rather than 1 and 0.

To construct an instance of this class, call either rwsf::ServletResponse::getOutputStream() or rwsf::ServletResponse::getWriter().

Constructor & Destructor Documentation

◆ ~ServletOutputStream()

virtual rwsf::ServletOutputStream::~ServletOutputStream ( )
virtual

Destructor.

Member Function Documentation

◆ getBuffer()

std::string rwsf::ServletOutputStream::getBuffer ( ) const

Returns the contents of the output buffer as a string.

◆ print() [1/16]

ServletOutputStream & rwsf::ServletOutputStream::print ( bool b)

Appends a bool value to the payload. This function appends the string true or the string false rather than 1 or 0.

◆ print() [2/16]

ServletOutputStream & rwsf::ServletOutputStream::print ( char c)

Appends a char value to the payload.

◆ print() [3/16]

ServletOutputStream & rwsf::ServletOutputStream::print ( const char * s)

Appends a NULL terminated string value to the payload.

◆ print() [4/16]

ServletOutputStream & rwsf::ServletOutputStream::print ( const std::string & str)

Appends an std::string value to the payload.

◆ print() [5/16]

ServletOutputStream & rwsf::ServletOutputStream::print ( const unsigned char * s)

Appends a NULL terminated string value to the payload.

◆ print() [6/16]

ServletOutputStream & rwsf::ServletOutputStream::print ( double s)

Appends a double value to the payload.

◆ print() [7/16]

ServletOutputStream & rwsf::ServletOutputStream::print ( float s)

Appends a float value to the payload.

◆ print() [8/16]

ServletOutputStream & rwsf::ServletOutputStream::print ( int s)

Appends an int value to the payload.

◆ print() [9/16]

ServletOutputStream & rwsf::ServletOutputStream::print ( long long s)

Appends a long long value to the payload.

◆ print() [10/16]

ServletOutputStream & rwsf::ServletOutputStream::print ( long s)

Appends a long value to the payload.

◆ print() [11/16]

ServletOutputStream & rwsf::ServletOutputStream::print ( short s)

Appends a short value to the payload.

◆ print() [12/16]

ServletOutputStream & rwsf::ServletOutputStream::print ( unsigned char uc)

Appends an unsigned char to the payload.

◆ print() [13/16]

ServletOutputStream & rwsf::ServletOutputStream::print ( unsigned int s)

Appends an unsigned int to the payload.

◆ print() [14/16]

ServletOutputStream & rwsf::ServletOutputStream::print ( unsigned long long s)

Appends an unsigned long long value to the payload.

◆ print() [15/16]

ServletOutputStream & rwsf::ServletOutputStream::print ( unsigned long s)

Appends an unsigned long value to the payload.

◆ print() [16/16]

ServletOutputStream & rwsf::ServletOutputStream::print ( unsigned short s)

Appends an unsigned short value to the payload.

◆ println() [1/17]

ServletOutputStream & rwsf::ServletOutputStream::println ( )

Appends a newline value to the payload.

◆ println() [2/17]

ServletOutputStream & rwsf::ServletOutputStream::println ( bool b)

Appends a bool value followed by a newline to the payload. This function appends the string true or the string false rather than 1 or 0.

◆ println() [3/17]

ServletOutputStream & rwsf::ServletOutputStream::println ( char c)

Appends a char value followed by a newline to the payload.

◆ println() [4/17]

ServletOutputStream & rwsf::ServletOutputStream::println ( const char * s)

Appends a NULL terminated string value followed by a newline to the payload.

◆ println() [5/17]

ServletOutputStream & rwsf::ServletOutputStream::println ( const std::string & str)

Appends an std::string value followed by a newline to the payload.

◆ println() [6/17]

ServletOutputStream & rwsf::ServletOutputStream::println ( const unsigned char * s)

Appends a NULL terminated string value followed by a newline to the payload.

◆ println() [7/17]

ServletOutputStream & rwsf::ServletOutputStream::println ( double s)

Appends a double value followed by a newline to the payload.

◆ println() [8/17]

ServletOutputStream & rwsf::ServletOutputStream::println ( float s)

Appends a float value followed by a newline to the payload.

◆ println() [9/17]

ServletOutputStream & rwsf::ServletOutputStream::println ( int s)

Appends an int value followed by a newline to the payload.

◆ println() [10/17]

ServletOutputStream & rwsf::ServletOutputStream::println ( long long s)

Appends a long long value followed by a newline to the payload.

◆ println() [11/17]

ServletOutputStream & rwsf::ServletOutputStream::println ( long s)

Appends a long value followed by a newline to the payload.

◆ println() [12/17]

ServletOutputStream & rwsf::ServletOutputStream::println ( short s)

Appends a short value followed by a newline to the payload.

◆ println() [13/17]

ServletOutputStream & rwsf::ServletOutputStream::println ( unsigned char uc)

Appends an unsigned char value followed by a newline to the payload.

◆ println() [14/17]

ServletOutputStream & rwsf::ServletOutputStream::println ( unsigned int s)

Appends an unsigned int value followed by a newline to the payload.

◆ println() [15/17]

ServletOutputStream & rwsf::ServletOutputStream::println ( unsigned long long s)

Appends an unsigned long long value followed by a newline to the payload.

◆ println() [16/17]

ServletOutputStream & rwsf::ServletOutputStream::println ( unsigned long s)

Appends an unsigned long value followed by a newline to the payload.

◆ println() [17/17]

ServletOutputStream & rwsf::ServletOutputStream::println ( unsigned short s)

Appends an unsigned short value followed by a newline to the payload.

◆ reset() [1/2]

void rwsf::ServletOutputStream::reset ( )

Clears any internal buffer.

◆ reset() [2/2]

void rwsf::ServletOutputStream::reset ( const std::string & newContents)

Clears any internal buffer, then sets the contents of the internal buffer to newContents.

Copyright © 2026 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.