См. документацию.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "OpenFile.h"
00025 OpenFile::OpenFile(Node* parent,string from, string to, IQType type, string id):TagIQ(parent,from, to, type, id,OpenFile_xmlns) {
00026
00027 }
00028
00029 OpenFile::OpenFile(const Node &basedNode):TagIQ(basedNode){
00030 cout<<"=======getattr constructor copy======"<<endl;
00031 }
00032
00033 int OpenFile::getResult(){
00034 Node* subNode=this->getKind(OpenFile_xmlns);
00035 return subNode->getKind(OpenFile_xmlnsDesc)->getXMLBodyInt();
00036 }
00037
00038 void OpenFile::setResult(int res){
00039 Node* subNode=this->getKind(OpenFile_xmlns);
00040 Node* n=new Node("result",subNode,OpenFile_xmlnsDesc);
00041 n->setXMLBody(res);
00042 }
00043
00044 void OpenFile::getFile(string &dir, struct fuse_file_info& fi,mode_t& mode){
00045 memset(&fi,0,sizeof(fi));
00046 cout<<"GF:1"<<endl;
00047 Node* subNode=this->getKind(OpenFile_xmlns);
00048 cout<<"GF:2"<<endl;
00049 Node* n= subNode->getKind(OpenFile_xmlnsDir);
00050 cout<<"GF:3"<<endl;
00051 dir=n->getXMLBody();
00052 cout<<"GF:4"<<endl;
00053 n= subNode->getKind(OpenFile_xmlnsMode);
00054 if(n!=NULL){
00055 mode=n->getXMLBodyInt();
00056 }else{
00057 mode=0;
00058 }
00059 FileInfoSubtag fif(*subNode->getKind(FileInfo_xmlns));
00060 cout<<"GF:5"<<endl;
00061 fi=fif.getFileInfo();
00062 cout<<"GF:6"<<endl;
00063
00064
00065 }
00066
00067 void OpenFile::setFile(string dir, const struct fuse_file_info& fi,mode_t mode){
00068 Node* subNode=this->getKind(OpenFile_xmlns);
00069 Node* n;
00070 n=new Node("dir",subNode,OpenFile_xmlnsDir);
00071 n->setXMLBody(dir);
00072 if (mode>0){
00073 n=new Node("mode",subNode,OpenFile_xmlnsMode);
00074 n->setXMLBody(mode);
00075 }
00076 FileInfoSubtag* fif = new FileInfoSubtag(subNode);
00077 fif->setFileInfo(fi);
00078
00079
00080
00081
00082
00083 }
00084
00085
00086
00087
00088
00089
00090 OpenFile::~OpenFile() {
00091
00092 }