Changes between Version 5 and Version 6 of Docs/Prog/Manual/ApplicationLibraries/lib825ev/File/CFile
- Timestamp:
- 08/23/10 07:37:34 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Docs/Prog/Manual/ApplicationLibraries/lib825ev/File/CFile
v5 v6 7 7 == Constructors == 8 8 9 * CFile(void); 10 * CFile(const string& strFilename); 11 * CFile(const char* pszfilename); 12 9 {{{ 10 CFile(void); 11 CFile(const string& strFilename); 12 CFile(const char* pszfilename); 13 }}} 13 14 These constructors just create a CFile object without opening a file. 14 15 *CFile(const string& strFilename, const string& strMode);16 *CFile(const string& strFilename, const char* pszMode);17 *CFile(const char* pszFilename, const string& strMode);18 *CFile(const char* pszFilename, const char* pszMode);19 15 {{{ 16 CFile(const string& strFilename, const string& strMode); 17 CFile(const string& strFilename, const char* pszMode); 18 CFile(const char* pszFilename, const string& strMode); 19 CFile(const char* pszFilename, const char* pszMode); 20 }}} 20 21 These constructors construct the file object and attempt to open the file. 21 22 … … 29 30 }}} 30 31 32 ==== Parameters ==== 33 * strFilename - filename 34 * pszFilename - filename 35 * strMode - mode 36 * pszMode - mode 37 31 38 == Member Functions == 32 39 … … 34 41 Opens a specified file, or using the filename already stored in the object. 35 42 36 * bool Open(const string& strFilename, const string& strMode); 37 * bool Open(const string& strFilename, const char* pszMode); 38 * bool Open(const char* pszFilename, const string& strMode); 39 * bool Open(const char* pszFilename, const char* pszMode); 40 * bool Open(const char* pszMode); 43 {{{ 44 bool Open(const string& strFilename, const string& strMode); 45 bool Open(const string& strFilename, const char* pszMode); 46 bool Open(const char* pszFilename, const string& strMode); 47 bool Open(const char* pszFilename, const char* pszMode); 48 bool Open(const char* pszMode); 49 }}} 41 50 42 51 ==== Parameters ==== … … 46 55 * pszMode - mode 47 56 48 ==== Return ====57 ==== Return Value ==== 49 58 50 59 Returns true if successful or false if unsuccessful. 51 60 61 ==== Remarks ==== 62 63 ==== Example ==== 64 65 {{{ 66 CFile file; 67 if(file.Open("/tmp/tmpfile", "w") == false) 68 { 69 DisplayText(0, 0, "Error writing temporary file"); 70 } 71 72 }}} 52 73 53 74 === Close === 54 75 Closes the file 55 * void Close(void); 76 {{{ 77 void Close(void); 78 }}} 56 79 57 80 ==== Parameters ==== … … 80 103 81 104 === IsReady === 105 Check the state of the serial CTS input 106 {{{ 107 bool IsReady(void); 108 }}} 109 ==== Parameters ==== 82 110 83 * bool IsReady(void); 111 Function does not accept any parameters. 112 113 ==== Return Value ==== 114 115 Function returns true if CTS is active, false if CTS is inactive. 116 117 ==== Remarks ==== 118 119 ==== Example ==== 120 121 {{{ 122 CFile fileLogOutput("/dev/ttyS1", "w"); 123 if(fileLogOutput.IsOpen()) 124 { 125 fileLogOutput.SetRTS(true); 126 if(fileLogOutput.IsReady() == false) 127 { 128 DisplayText(0, 0, "Printer offline, or disconnected"); 129 } 130 } 131 }}} 132 84 133 85 134 === SetRTS === 135 Set the state of the serial RTS output 86 136 87 * bool SetRTS(bool on = true); 137 {{{ 138 bool SetRTS(bool bRTSOn = true); 139 }}} 140 141 ==== Parameters ==== 142 143 * bRTSOn - true to turn on RTS output, false to turn off RTS output 144 145 ==== Return Value ==== 146 147 * Returns true if successfully set RTS state, false otherwise. 148 149 ==== Remarks ==== 150 151 ==== Example ==== 152 153 {{{ 154 CFile fileLogOutput("/dev/ttyS1", "w"); 155 fileLogOutput.SetRTS(true); 156 }}} 157 158 88 159 89 160 === GetFile ===