Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

ZIDFile.h

Go to the documentation of this file.
00001 /*
00002   Copyright (C) 2006-2007 Werner Dittmann
00003 
00004   This program is free software: you can redistribute it and/or modify
00005   it under the terms of the GNU General Public License as published by
00006   the Free Software Foundation, either version 3 of the License, or
00007   (at your option) any later version.
00008 
00009   This program is distributed in the hope that it will be useful,
00010   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012   GNU General Public License for more details.
00013 
00014   You should have received a copy of the GNU General Public License
00015   along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016 */
00017 
00018 #include <stdio.h>
00019 
00020 #include <libzrtpcpp/ZIDRecord.h>
00021 
00022 #ifndef _ZIDFILE_H_
00023 #define _ZIDFILE_H_
00024 
00038 class ZIDFile {
00039 
00040 private:
00041 
00042     FILE* zidFile;
00043     unsigned char associatedZid[IDENTIFIER_LEN];
00048     ZIDFile(): zidFile(NULL) {};
00049     ~ZIDFile();
00050 
00051 public:
00052 
00063     static ZIDFile* getInstance();
00083     int open(char *name);
00084 
00091     int isOpen() { return (zidFile == NULL); };
00092 
00097     void close();
00098 
00113     unsigned int getRecord(ZIDRecord *zidRecord);
00114 
00127     unsigned int saveRecord(ZIDRecord *zidRecord);
00128 
00135     const unsigned char* getZid() { return associatedZid; };
00136 };
00137 #endif
00138 

© sourcejam.com 2005-2008