-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbencode.h
26 lines (20 loc) · 875 Bytes
/
bencode.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//
// Copyright (C) 2003-2004 Trevor Hogan
//
#ifndef BENCODE_H
#define BENCODE_H
string EncodeInt( const CAtomInt &x );
string EncodeLong( const CAtomLong &x );
string EncodeString( const CAtomString &x );
string EncodeList( const CAtomList &x );
string EncodeDicti( const CAtomDicti &x );
string Encode( CAtom *pAtom );
// the decode functions allocate memory, so be SURE to delete it
// CAtomInt *DecodeInt( const string &x, unsigned long iStart = 0 );
CAtomLong *DecodeLong( const string &x, unsigned long iStart = 0 );
CAtomString *DecodeString( const string &x, unsigned long iStart = 0 );
CAtomList *DecodeList( const string &x, unsigned long iStart = 0 );
CAtomDicti *DecodeDicti( const string &x, unsigned long iStart = 0 );
CAtom *Decode( const string &x, unsigned long iStart = 0 );
CAtom *DecodeFile( const char *szFile );
#endif