as2js: as2js::StandardOutput Class Reference

#include <stream.h>

Inheritance diagram for as2js::StandardOutput:
Collaboration diagram for as2js::StandardOutput:
Public Member Functions  StandardOutput ()  Initializes the standard output object. More...
  Positionget_position ()  Get the position object of the input object. More...
  Position const & get_position () const  Get the position object of the input object. More...
  void write (String const &data)  Write data to this output stream. More...
  Protected Types typedef std::shared_ptr< StandardOutputpointer_t   Protected Member Functions virtual void internal_write (String const &data)  Write a string to standard output. More...
  Protected Attributes Position f_position = Position()   Detailed Description

Definition at line 272 of file stream.h.

Member Typedef Documentation
typedef std::shared_ptr<StandardOutput> as2js::StandardOutput::pointer_t protected

Definition at line 279 of file stream.h.

Constructor & Destructor Documentation
as2js::StandardOutput::StandardOutput ( )

This function initializes the standard output object, more specifically it defines its filename as "-".

Definition at line 874 of file stream.cpp.

References as2js::Input::get_position(), and as2js::Position::set_filename().

Member Function Documentation
Position & as2js::Output::get_position ( ) inherited

The stream manages a position object. The call can use this function to retrieve a read/write version of the current position.

Returns
A modifiable version of the position object.

Definition at line 825 of file stream.cpp.

References as2js::Input::f_position.

Position const & as2js::Output::get_position ( ) const inherited

The stream manages a position object. The call can use this function to retrieve a read-only version of the current position.

Returns
A constant version of the position object.

Definition at line 838 of file stream.cpp.

References as2js::Input::f_position.

void as2js::StandardOutput::internal_write ( String const &  data) protectedvirtual

This function writes the specified string of data to the output in UTF-8 format.

Note that the streams do not save a BOM at the start of files.

Parameters
[in]dataThe string to write in the standard output.

Implements as2js::Output.

Definition at line 889 of file stream.cpp.

References as2js::AS_ERR_IO_ERROR, as2js::Input::get_position(), as2js::MESSAGE_LEVEL_FATAL, and as2js::String::to_utf8().

void as2js::Output::write ( String const &  data) inherited

This function writes the specified string to the output stream. Since we pretty much only support text based files, we just use this format.

All outputs are done in UTF-8.

If the function cannot write to the destination, then it throws an error.

Parameters
[in]dataThe string to be written to the output stream.

Definition at line 857 of file stream.cpp.

Member Data Documentation
Position as2js::Output::f_position = Position() protectedinherited

Definition at line 268 of file stream.h.


The documentation for this class was generated from the following files:
  • /home/snapwebsites/snapcpp/contrib/as2js/include/as2js/stream.h
  • /home/snapwebsites/snapcpp/contrib/as2js/lib/stream.cpp

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.

Syndicate content

Snap! Websites
An Open Source CMS System in C++

Contact Us Directly