Fixed MSVC warnings, all inocuous
This commit is contained in:
@@ -63,7 +63,7 @@ void Binc::MimeDocument::parseOnlyHeader(int fd)
|
||||
nlines = 0;
|
||||
nbodylines = 0;
|
||||
|
||||
doParseOnlyHeader(doc_mimeSource, "");
|
||||
doParseOnlyHeader(doc_mimeSource);
|
||||
}
|
||||
|
||||
void Binc::MimeDocument::parseOnlyHeader(istream& s)
|
||||
@@ -86,12 +86,11 @@ void Binc::MimeDocument::parseOnlyHeader(istream& s)
|
||||
nlines = 0;
|
||||
nbodylines = 0;
|
||||
|
||||
doParseOnlyHeader(doc_mimeSource, "");
|
||||
doParseOnlyHeader(doc_mimeSource);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
int Binc::MimePart::doParseOnlyHeader(MimeInputSource *ms,
|
||||
const string &toboundary)
|
||||
int Binc::MimePart::doParseOnlyHeader(MimeInputSource *ms)
|
||||
{
|
||||
mimeSource = ms;
|
||||
string name;
|
||||
|
||||
+123
-124
@@ -32,155 +32,154 @@
|
||||
|
||||
namespace Binc {
|
||||
|
||||
class MimeInputSource;
|
||||
class MimeInputSource;
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
class HeaderItem {
|
||||
private:
|
||||
mutable std::string key;
|
||||
mutable std::string value;
|
||||
//----------------------------------------------------------------------
|
||||
class HeaderItem {
|
||||
private:
|
||||
mutable std::string key;
|
||||
mutable std::string value;
|
||||
|
||||
public:
|
||||
inline const std::string &getKey(void) const { return key; }
|
||||
inline const std::string &getValue(void) const { return value; }
|
||||
public:
|
||||
inline const std::string &getKey(void) const { return key; }
|
||||
inline const std::string &getValue(void) const { return value; }
|
||||
|
||||
//--
|
||||
HeaderItem(void);
|
||||
HeaderItem(const std::string &key, const std::string &value);
|
||||
//--
|
||||
HeaderItem(void);
|
||||
HeaderItem(const std::string &key, const std::string &value);
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
class Header {
|
||||
private:
|
||||
mutable std::vector<HeaderItem> content;
|
||||
|
||||
public:
|
||||
bool getFirstHeader(const std::string &key, HeaderItem &dest) const;
|
||||
bool getAllHeaders(const std::string &key, std::vector<HeaderItem> &dest) const;
|
||||
void add(const std::string &name, const std::string &content);
|
||||
void clear(void);
|
||||
|
||||
//--
|
||||
Header(void);
|
||||
~Header(void);
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
class IODevice;
|
||||
class MimeDocument;
|
||||
class MimePart {
|
||||
protected:
|
||||
public:
|
||||
mutable bool multipart;
|
||||
mutable bool messagerfc822;
|
||||
mutable std::string subtype;
|
||||
mutable std::string boundary;
|
||||
|
||||
mutable unsigned int headerstartoffsetcrlf;
|
||||
mutable unsigned int headerlength;
|
||||
|
||||
mutable unsigned int bodystartoffsetcrlf;
|
||||
mutable unsigned int bodylength;
|
||||
mutable unsigned int nlines;
|
||||
mutable unsigned int nbodylines;
|
||||
mutable unsigned int size;
|
||||
|
||||
public:
|
||||
enum FetchType {
|
||||
FetchBody,
|
||||
FetchHeader,
|
||||
FetchMime
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
class Header {
|
||||
private:
|
||||
mutable std::vector<HeaderItem> content;
|
||||
mutable Header h;
|
||||
|
||||
public:
|
||||
bool getFirstHeader(const std::string &key, HeaderItem &dest) const;
|
||||
bool getAllHeaders(const std::string &key, std::vector<HeaderItem> &dest) const;
|
||||
void add(const std::string &name, const std::string &content);
|
||||
void clear(void);
|
||||
mutable std::vector<MimePart> members;
|
||||
|
||||
//--
|
||||
Header(void);
|
||||
~Header(void);
|
||||
};
|
||||
inline const std::string &getSubType(void) const { return subtype; }
|
||||
inline bool isMultipart(void) const { return multipart; }
|
||||
inline bool isMessageRFC822(void) const { return messagerfc822; }
|
||||
inline unsigned int getSize(void) const { return bodylength; }
|
||||
inline unsigned int getNofLines(void) const { return nlines; }
|
||||
inline unsigned int getNofBodyLines(void) const { return nbodylines; }
|
||||
inline unsigned int getBodyLength(void) const { return bodylength; }
|
||||
inline unsigned int getBodyStartOffset(void) const { return bodystartoffsetcrlf; }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
class IODevice;
|
||||
class MimeDocument;
|
||||
class MimePart {
|
||||
protected:
|
||||
public:
|
||||
mutable bool multipart;
|
||||
mutable bool messagerfc822;
|
||||
mutable std::string subtype;
|
||||
mutable std::string boundary;
|
||||
void printBody(Binc::IODevice &output, unsigned int startoffset, unsigned int length) const;
|
||||
void getBody(std::string& s, unsigned int startoffset, unsigned int length) const;
|
||||
virtual void clear(void);
|
||||
|
||||
mutable unsigned int headerstartoffsetcrlf;
|
||||
mutable unsigned int headerlength;
|
||||
virtual int doParseOnlyHeader(MimeInputSource *ms);
|
||||
virtual int doParseFull(MimeInputSource *ms,
|
||||
const std::string &toboundary, int &boundarysize);
|
||||
|
||||
mutable unsigned int bodystartoffsetcrlf;
|
||||
mutable unsigned int bodylength;
|
||||
mutable unsigned int nlines;
|
||||
mutable unsigned int nbodylines;
|
||||
mutable unsigned int size;
|
||||
MimePart(void);
|
||||
virtual ~MimePart(void);
|
||||
|
||||
public:
|
||||
enum FetchType {
|
||||
FetchBody,
|
||||
FetchHeader,
|
||||
FetchMime
|
||||
};
|
||||
private:
|
||||
MimeInputSource *mimeSource;
|
||||
|
||||
mutable Header h;
|
||||
bool parseOneHeaderLine(Binc::Header *header, unsigned int *nlines);
|
||||
|
||||
mutable std::vector<MimePart> members;
|
||||
bool skipUntilBoundary(const std::string &delimiter,
|
||||
unsigned int *nlines, bool *eof);
|
||||
inline void postBoundaryProcessing(bool *eof,
|
||||
unsigned int *nlines,
|
||||
int *boundarysize,
|
||||
bool *foundendofpart);
|
||||
void parseMultipart(const std::string &boundary,
|
||||
const std::string &toboundary,
|
||||
bool *eof,
|
||||
unsigned int *nlines,
|
||||
int *boundarysize,
|
||||
bool *foundendofpart,
|
||||
unsigned int *bodylength,
|
||||
std::vector<Binc::MimePart> *members);
|
||||
void parseSinglePart(const std::string &toboundary,
|
||||
int *boundarysize,
|
||||
unsigned int *nbodylines,
|
||||
unsigned int *nlines,
|
||||
bool *eof, bool *foundendofpart,
|
||||
unsigned int *bodylength);
|
||||
void parseHeader(Binc::Header *header, unsigned int *nlines);
|
||||
void analyzeHeader(Binc::Header *header, bool *multipart,
|
||||
bool *messagerfc822, std::string *subtype,
|
||||
std::string *boundary);
|
||||
void parseMessageRFC822(std::vector<Binc::MimePart> *members,
|
||||
bool *foundendofpart,
|
||||
unsigned int *bodylength,
|
||||
unsigned int *nbodylines,
|
||||
const std::string &toboundary);
|
||||
};
|
||||
|
||||
inline const std::string &getSubType(void) const { return subtype; }
|
||||
inline bool isMultipart(void) const { return multipart; }
|
||||
inline bool isMessageRFC822(void) const { return messagerfc822; }
|
||||
inline unsigned int getSize(void) const { return bodylength; }
|
||||
inline unsigned int getNofLines(void) const { return nlines; }
|
||||
inline unsigned int getNofBodyLines(void) const { return nbodylines; }
|
||||
inline unsigned int getBodyLength(void) const { return bodylength; }
|
||||
inline unsigned int getBodyStartOffset(void) const { return bodystartoffsetcrlf; }
|
||||
//----------------------------------------------------------------------
|
||||
class MimeDocument : public MimePart {
|
||||
public:
|
||||
MimeDocument(void);
|
||||
~MimeDocument(void);
|
||||
|
||||
void printBody(Binc::IODevice &output, unsigned int startoffset, unsigned int length) const;
|
||||
void getBody(std::string& s, unsigned int startoffset, unsigned int length) const;
|
||||
virtual void clear(void);
|
||||
void parseOnlyHeader(int fd);
|
||||
void parseFull(int fd);
|
||||
void parseOnlyHeader(std::istream& s);
|
||||
void parseFull(std::istream& s);
|
||||
|
||||
virtual int doParseOnlyHeader(MimeInputSource *ms,
|
||||
const std::string &toboundary);
|
||||
virtual int doParseFull(MimeInputSource *ms,
|
||||
const std::string &toboundary, int &boundarysize);
|
||||
|
||||
MimePart(void);
|
||||
virtual ~MimePart(void);
|
||||
|
||||
private:
|
||||
MimeInputSource *mimeSource;
|
||||
|
||||
bool parseOneHeaderLine(Binc::Header *header, unsigned int *nlines);
|
||||
|
||||
bool skipUntilBoundary(const std::string &delimiter,
|
||||
unsigned int *nlines, bool *eof);
|
||||
inline void postBoundaryProcessing(bool *eof,
|
||||
unsigned int *nlines,
|
||||
int *boundarysize,
|
||||
bool *foundendofpart);
|
||||
void parseMultipart(const std::string &boundary,
|
||||
const std::string &toboundary,
|
||||
bool *eof,
|
||||
unsigned int *nlines,
|
||||
int *boundarysize,
|
||||
bool *foundendofpart,
|
||||
unsigned int *bodylength,
|
||||
std::vector<Binc::MimePart> *members);
|
||||
void parseSinglePart(const std::string &toboundary,
|
||||
int *boundarysize,
|
||||
unsigned int *nbodylines,
|
||||
unsigned int *nlines,
|
||||
bool *eof, bool *foundendofpart,
|
||||
unsigned int *bodylength);
|
||||
void parseHeader(Binc::Header *header, unsigned int *nlines);
|
||||
void analyzeHeader(Binc::Header *header, bool *multipart,
|
||||
bool *messagerfc822, std::string *subtype,
|
||||
std::string *boundary);
|
||||
void parseMessageRFC822(std::vector<Binc::MimePart> *members,
|
||||
bool *foundendofpart,
|
||||
unsigned int *bodylength,
|
||||
unsigned int *nbodylines,
|
||||
const std::string &toboundary);
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
class MimeDocument : public MimePart {
|
||||
public:
|
||||
MimeDocument(void);
|
||||
~MimeDocument(void);
|
||||
|
||||
void parseOnlyHeader(int fd);
|
||||
void parseFull(int fd);
|
||||
void parseOnlyHeader(std::istream& s);
|
||||
void parseFull(std::istream& s);
|
||||
|
||||
void clear(void);
|
||||
void clear(void);
|
||||
|
||||
bool isHeaderParsed(void) const
|
||||
bool isHeaderParsed(void) const
|
||||
{
|
||||
return headerIsParsed;
|
||||
}
|
||||
bool isAllParsed(void) const
|
||||
bool isAllParsed(void) const
|
||||
{
|
||||
return allIsParsed;
|
||||
}
|
||||
|
||||
private:
|
||||
bool headerIsParsed;
|
||||
bool allIsParsed;
|
||||
MimeInputSource *doc_mimeSource;
|
||||
};
|
||||
private:
|
||||
bool headerIsParsed;
|
||||
bool allIsParsed;
|
||||
MimeInputSource *doc_mimeSource;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user