//
// InternetTextMessageHeader.h
//

#pragma once

#include <stdio.h>

#include <Raym/Raym.h>

namespace NET
{

class InternetTextMessageHeader : public Raym::Object
{
private:
    Raym::StringEncoding    _encoding;
    Raym::Dictionary *      _fields;
    Raym::Data *            _data;

protected:
    InternetTextMessageHeader();
    ~InternetTextMessageHeader();

public:
    static InternetTextMessageHeader *alloc();
    InternetTextMessageHeader *init();
    InternetTextMessageHeader *initWithData(Raym::Data *data);
    InternetTextMessageHeader *initWithArray(Raym::Array *array);
    InternetTextMessageHeader *initWithSocket(SOCKET sock);
    InternetTextMessageHeader *retain();
    InternetTextMessageHeader *autorelease();

    Raym::StringEncoding encoding();

    Raym::Array *fieldNames();
    Raym::String *fieldBodyForName(Raym::String *name);
    Raym::String *fieldBodyForName(const char *name);

    void setFieldBodyWithName(Raym::String *body, Raym::String *name);
    void setFieldBodyWithName(const char *body, Raym::String *name);
    void setFieldBodyWithName(Raym::String *body, const char *name);
    void setFieldBodyWithName(const char *body, const char *name);

    Raym::Data *data();

    virtual const char *className();
};

} // NET

