kget
bdecoder.h
Go to the documentation of this file.00001 /*************************************************************************** 00002 * Copyright (C) 2005 by Joris Guisson * 00003 * joris.guisson@gmail.com * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 00019 ***************************************************************************/ 00020 #ifndef BTBDECODER_H 00021 #define BTBDECODER_H 00022 00023 #include <qstring.h> 00024 #include <util/constants.h> 00025 #include <btcore_export.h> 00026 00027 namespace bt 00028 { 00029 00030 class BNode; 00031 class BListNode; 00032 class BDictNode; 00033 class BValueNode; 00034 00041 class BTCORE_EXPORT BDecoder 00042 { 00043 const QByteArray & data; 00044 Uint32 pos; 00045 bool verbose; 00046 public: 00053 BDecoder(const QByteArray & data,bool verbose,Uint32 off = 0); 00054 virtual ~BDecoder(); 00055 00061 BNode* decode(); 00062 private: 00063 BDictNode* parseDict(); 00064 BListNode* parseList(); 00065 BValueNode* parseInt(); 00066 BValueNode* parseString(); 00067 }; 00068 00069 } 00070 00071 #endif
KDE 4.2 API Reference