1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-08-15 19:22:45 +03:00

Run new astyle formatter against libs Bridge, SpacebrewYun and Temboo

This commit is contained in:
Federico Fissore
2013-10-21 10:13:31 +02:00
parent b4c68b3dff
commit 00bdd3df03
19 changed files with 841 additions and 805 deletions

View File

@@ -26,76 +26,76 @@
#define FILE_APPEND 2
class File : public Stream {
public:
File(BridgeClass &b = Bridge);
File(const char *_filename, uint8_t _mode, BridgeClass &b = Bridge);
~File();
virtual size_t write(uint8_t);
virtual size_t write(const uint8_t *buf, size_t size);
virtual int read();
virtual int peek();
virtual int available();
virtual void flush();
int read(void *buf, uint16_t nbyte);
boolean seek(uint32_t pos);
uint32_t position();
uint32_t size();
void close();
operator bool();
const char * name();
boolean isDirectory();
File openNextFile(uint8_t mode = FILE_READ);
void rewindDirectory(void);
//using Print::write;
private:
void doBuffer();
uint8_t buffered;
uint8_t readPos;
uint16_t dirPosition;
static const int BUFFER_SIZE = 64;
uint8_t buffer[BUFFER_SIZE];
private:
BridgeClass &bridge;
String filename;
uint8_t mode;
uint8_t handle;
public:
File(BridgeClass &b = Bridge);
File(const char *_filename, uint8_t _mode, BridgeClass &b = Bridge);
~File();
virtual size_t write(uint8_t);
virtual size_t write(const uint8_t *buf, size_t size);
virtual int read();
virtual int peek();
virtual int available();
virtual void flush();
int read(void *buf, uint16_t nbyte);
boolean seek(uint32_t pos);
uint32_t position();
uint32_t size();
void close();
operator bool();
const char * name();
boolean isDirectory();
File openNextFile(uint8_t mode = FILE_READ);
void rewindDirectory(void);
//using Print::write;
private:
void doBuffer();
uint8_t buffered;
uint8_t readPos;
uint16_t dirPosition;
static const int BUFFER_SIZE = 64;
uint8_t buffer[BUFFER_SIZE];
private:
BridgeClass &bridge;
String filename;
uint8_t mode;
uint8_t handle;
};
class FileSystemClass {
public:
FileSystemClass() : bridge(Bridge) { }
FileSystemClass(BridgeClass &_b) : bridge(_b) { }
boolean begin();
// Open the specified file/directory with the supplied mode (e.g. read or
// write, etc). Returns a File object for interacting with the file.
// Note that currently only one file can be open at a time.
File open(const char *filename, uint8_t mode = FILE_READ);
public:
FileSystemClass() : bridge(Bridge) { }
FileSystemClass(BridgeClass &_b) : bridge(_b) { }
// Methods to determine if the requested file path exists.
boolean exists(const char *filepath);
boolean begin();
// Create the requested directory heirarchy--if intermediate directories
// do not exist they will be created.
boolean mkdir(const char *filepath);
// Delete the file.
boolean remove(const char *filepath);
boolean rmdir(const char *filepath);
// Open the specified file/directory with the supplied mode (e.g. read or
// write, etc). Returns a File object for interacting with the file.
// Note that currently only one file can be open at a time.
File open(const char *filename, uint8_t mode = FILE_READ);
private:
friend class File;
BridgeClass &bridge;
// Methods to determine if the requested file path exists.
boolean exists(const char *filepath);
// Create the requested directory heirarchy--if intermediate directories
// do not exist they will be created.
boolean mkdir(const char *filepath);
// Delete the file.
boolean remove(const char *filepath);
boolean rmdir(const char *filepath);
private:
friend class File;
BridgeClass &bridge;
};
extern FileSystemClass FileSystem;