PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
PEBLStream.h
Go to the documentation of this file.
1//* -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- */
3// Name: libs/PEBLStream.h
4// Purpose: Stream-based Function Library for PEBL
5// Author: Shane T. Mueller, Ph.D.
6// Copyright: (c) 2003-2026 Shane T. Mueller <smueller@obereed.net>
7// License: GPL 2
8//
9//
10//
11// This file is part of the PEBL project.
12//
13// PEBL is free software; you can redistribute it and/or modify
14// it under the terms of the GNU General Public License as published by
15// the Free Software Foundation; either version 2 of the License, or
16// (at your option) any later version.
17//
18// PEBL is distributed in the hope that it will be useful,
19// but WITHOUT ANY WARRANTY; without even the implied warranty of
20// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21// GNU General Public License for more details.
22//
23// You should have received a copy of the GNU General Public License
24// along with PEBL; if not, write to the Free Software
25// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27#ifndef __PEBLSTREAM_H__
28#define __PEBLSTREAM_H__
29
30
31#include "../base/Variant.h"
32#include "../base/PComplexData.h"
33#include "../base/PList.h"
34#include "../base/PEBLObject.h"
35
36
37namespace PEBLStream
38{
41
44
49
52
55
57
59
62
65
68
71
75
78
81
84
87
90
91 //Copies the contents of one file to another.
93#ifdef PEBL_WIN32
94#ifdef CopyFile
95#undef CopyFile // Undefine Windows CopyFile macro
96#endif
97#endif
99
100 // The following control TCP/IP connections and communications.
101 // Now always available (stub implementations when PEBL_NETWORK not defined)
104
105
109
113
116
119
120 // HTTP functions - now always available (stub implementations when PEBL_HTTP not defined)
123
126
129
132
133
134#ifdef PEBL_USEPORTS
135 //These functions open, send, receive, and close
136 //a parallel port object.
137 Variant OpenPPort(Variant v);
138 Variant SetPPortState(Variant v);
139 Variant GetPPortState(Variant v);
140 Variant SetPPortMode(Variant v);
141
142
143
144
145
146 //These functions open, send, receive, and close
147 //a serial (com) port; also usb-mounted comport devices
148 //ala ftdi chips and the dlp-io8 and relatives.
149
150 Variant OpenComPort(Variant v);
151 Variant ComPortSendByte(Variant v);
152 Variant ComPortGetByte(Variant v);
153 Variant ComPortGetBytes(Variant v);
154
155
156
157#endif
158
159
160}
161#endif
Variant SendData(Variant v)
Variant GetData(Variant v)
Variant AcceptNetworkConnection(Variant v)
Variant ConnectToHost(Variant v)
Variant FileReadText(Variant v)
This will read all of the text in a file into a single variant.
Variant GetMyIPAddress(Variant v)
Variant PostHTTPFile(Variant v)
Variant FileOpenAppend(Variant v)
This opens a filestream for writing, appending to end of file.
Variant FileReadWord(Variant v)
Variant GetIPAddress(Variant v)
Variant FileReadLine(Variant v)
Reads until the next line.
Variant FilePrint_(Variant v)
This prints contents of variant to file, without appending a newline.
Variant CopyFile(Variant v)
Variant FileOpenOverwrite(Variant v)
This opens a filestream for writing, replacing current file, without making a backup.
Variant FileReadCharacter(Variant v)
Reads a character from a file.
Variant EndOfFile(Variant v)
This detects if you are at the end of a file.
Variant WritePNG(Variant v)
Variant GetHTTPFile(Variant v)
Variant FileClose(Variant v)
This Closes a filestream.
Variant FileReadTable(Variant v)
Makes a list of lists, with each row contained in a list.
Variant EndOfLine(Variant v)
This detects if you are at the end of a line.
Variant FileOpenRead(Variant v)
This opens a filestream for reading.
Variant MD5File(Variant v)
Variant OpenNetworkListener(Variant v)
Variant GetHTTPText(Variant v)
Variant SetNetworkPort(Variant v)
Variant FileOpenWrite(Variant v)
This opens a filestream for writing.
Variant ConnectToIP(Variant v)
Variant CheckForNetworkConnection(Variant v)
Variant ParseJSON(Variant v)
Variant PostHTTP(Variant v)
Variant CloseNetworkConnection(Variant v)
Variant AppendFile(Variant v)
Variant WaitForNetworkConnection(Variant v)
Variant MD5Sum(Variant v)
Variant Format(Variant v)
Variant Print(Variant v)
This prints the argument with a newline character.
Variant Print_(Variant v)
This prints the argument without a linebreak at the end.
Variant FilePrint(Variant v)
This prints contents of variant to file, followed by a newline.
Variant FileReadList(Variant v)
Places all words in file into a list.