|
PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
|
#include <PStream.h>
Public Member Functions | |
| PStream (const std::string &filename, StreamDirection dir, StreamType type) | |
| The Standard constructor. | |
| PStream (const PStream &ps) | |
| virtual | ~PStream () |
| The Standard destructor. | |
| void | Open (const std::string &filename, StreamDirection dir, StreamType type) |
| void | WriteChar (const char character) |
| This method sends a single character to the stream. | |
| void | WriteString (const std::string &buffer) |
| This method just writes the char* string to the stream. | |
| void | WriteBuffer (const std::string &buffer, unsigned int length) |
| char | ReadChar () |
| std::string | ReadToken (const char separator) |
| This reads up until the next separator token (or eof character) | |
| std::string | ReadLine () |
| std::string | ReadLineClean () |
| bool | Eof () |
| bool | Eol () |
| bool | Close () |
| virtual PEBL_DEVICE_TYPE | GetDeviceType () |
| virtual bool | SetProperty (std::string, Variant v) |
| virtual Variant | GetProperty (std::string) const |
| virtual ObjectValidationError | ValidateProperty (std::string, Variant v) const |
| virtual ObjectValidationError | ValidateProperty (std::string) const |
Public Member Functions inherited from PDevice | |
| PDevice () | |
| The Standard constructor. | |
| virtual | ~PDevice () |
| The Standard destructor. | |
| virtual int | GetState (int iface) const |
Public Member Functions inherited from PEBLObjectBase | |
| PEBLObjectBase () | |
| Standard Constructor. | |
| PEBLObjectBase (ComplexDataType cdt) | |
| Standard Constructor. | |
| PEBLObjectBase (const PEBLObjectBase &pob) | |
| virtual | ~PEBLObjectBase () |
| Standard Destructor. | |
| virtual bool | InitializeProperty (std::string name, Variant v) |
| Variant | GetProperty (std::string) const |
| ComplexDataType | GetType () |
| virtual std::string | ObjectName () const |
| virtual std::ostream & | PrintProperties (std::ostream &out) |
| virtual Variant | GetPropertyList () |
Protected Member Functions | |
| virtual std::ostream & | SendToStream (std::ostream &out) const |
Additional Inherited Members | |
Protected Attributes inherited from PEBLObjectBase | |
| ComplexDataType | mCDT |
| std::map< std::string, Variant > | mProperties |
This is the base File Stream class. It is used to read and write files. It is also a subclass of PDevice, which means that it can be added to the event loop for interesting between-process communications, and probably even used as a basis for other input devices.
| PStream::PStream | ( | const std::string & | filename, |
| StreamDirection | dir, | ||
| StreamType | type | ||
| ) |
The Standard constructor.
| PStream::PStream | ( | const PStream & | ps | ) |
Definition at line 112 of file PStream.cpp.
References NULL.
|
virtual |
The Standard destructor.
This is the standard pNode destructor.
Definition at line 401 of file PStream.cpp.
| bool PStream::Close | ( | ) |
Definition at line 394 of file PStream.cpp.
Referenced by PEBLStream::FileClose(), PEBLStream::FileReadList(), PEBLStream::FileReadTable(), PEBLStream::FileReadText(), and main().
| bool PStream::Eof | ( | ) |
Definition at line 388 of file PStream.cpp.
Referenced by PEBLStream::EndOfFile(), PEBLStream::FileReadList(), PEBLStream::FileReadTable(), PEBLStream::FileReadText(), and main().
| bool PStream::Eol | ( | ) |
Definition at line 356 of file PStream.cpp.
Referenced by PEBLStream::EndOfLine(), and ReadToken().
|
inlinevirtual |
|
virtual |
Definition at line 430 of file PStream.cpp.
References PEBLObjectBase::GetProperty().
| void PStream::Open | ( | const std::string & | filename, |
| StreamDirection | dir, | ||
| StreamType | type | ||
| ) |
Definition at line 118 of file PStream.cpp.
References sdAppend, sdRead, sdWrite, and PError::SignalFatalError().
Referenced by main().
| char PStream::ReadChar | ( | ) |
This reads a single character from the filestream and returns it.
Definition at line 230 of file PStream.cpp.
References sdRead, and PError::SignalFatalError().
Referenced by PEBLStream::FileReadCharacter(), and main().
| std::string PStream::ReadLine | ( | ) |
This reads up until the next eol/eof character, including the newline character at the end.
Definition at line 290 of file PStream.cpp.
References sdRead, and PError::SignalFatalError().
Referenced by PEBLStream::FileReadText(), and main().
| std::string PStream::ReadLineClean | ( | ) |
Definition at line 323 of file PStream.cpp.
References sdRead, and PError::SignalFatalError().
Referenced by PEBLStream::FileReadLine(), PEBLStream::FileReadList(), and PEBLStream::FileReadTable().
| std::string PStream::ReadToken | ( | const char | separator | ) |
This reads up until the next separator token (or eof character)
Definition at line 251 of file PStream.cpp.
References Eol(), sdRead, and PError::SignalFatalError().
Referenced by PEBLStream::FileReadWord(), and main().
|
protectedvirtual |
Reimplemented from PDevice.
Definition at line 408 of file PStream.cpp.
|
virtual |
Reimplemented from PEBLObjectBase.
Definition at line 416 of file PStream.cpp.
References PEBLObjectBase::SetProperty().
|
virtual |
Reimplemented from PEBLObjectBase.
Definition at line 444 of file PStream.cpp.
References OVE_INVALID_PROPERTY_NAME, and OVE_VALID.
|
virtual |
Reimplemented from PEBLObjectBase.
Definition at line 438 of file PStream.cpp.
References ValidateProperty().
Referenced by ValidateProperty().
| void PStream::WriteBuffer | ( | const std::string & | buffer, |
| unsigned int | length | ||
| ) |
This method sends the number of bytes specified by the length parameter from the buffer to the stream. This could be dangerous if the user is allowed to specify these things themselves.
Definition at line 190 of file PStream.cpp.
References sdAppend, sdWrite, and PError::SignalFatalError().
Referenced by main().
| void PStream::WriteChar | ( | const char | character | ) |
This method sends a single character to the stream.
Definition at line 172 of file PStream.cpp.
References sdAppend, sdWrite, and PError::SignalFatalError().
Referenced by main().
| void PStream::WriteString | ( | const std::string & | buffer | ) |
This method just writes the char* string to the stream.
Definition at line 211 of file PStream.cpp.
References sdAppend, sdWrite, and PError::SignalFatalError().
Referenced by PEBLStream::FilePrint(), PEBLStream::FilePrint_(), and main().