瀏覽代碼

Enforce File derived class rules

main
PaulStoffregen 4 年之前
父節點
當前提交
fa84ee5d6b
共有 1 個檔案被更改,包括 7 行新增1 行删除
  1. +7
    -1
      src/SD.h

+ 7
- 1
src/SD.h 查看文件

@@ -52,8 +52,14 @@

class SDFile : public File
{
public:
private:
// Classes derived from File are never meant to be constructed from
// anywhere other than openNextFile() and open() in their parent FS
// class. Only the abstract File class which references these
// derived classes is meant to have a public constructor!
SDFile(const SDFAT_FILE &file) : sdfatfile(file), filename(nullptr) { }
friend class SDClass;
public:
virtual ~SDFile(void) {
if (sdfatfile) sdfatfile.close();
if (filename) free(filename);

Loading…
取消
儲存