AppendHeaderLines.IncrementalValue

Utility class to append a response message header line where the value is appended incrementally.

Usage in a HttpResponse subclass:

class MyHttpResponse : HttpResponse
{
    protected override addHeaders ( AppendHeaderLines append )
    {
        // append "Hello: World!\r\n"

        {
            // constructor appends "Hello: "

            scope inc_val = append.new IncrementalValue("Hello");

             // append "Wor" ~ "ld!"

            inc_val.appendToValue("Wor");
            inc_val.appendToValue("ld!");

            // destructor appends "\r\n"
        }
    }
}

Note: At most one instance may exist at a time per outer instance.

class AppendHeaderLines
class IncrementalValue {}

Constructors

this
this(cstring name)

Constructor; opens a response message header line by appending name ~ ": " to the response message content.

Destructor

~this
~this()

Destructor; closes a response message header line by appending "\r\n" to the response message content.

Members

Functions

appendToValue
void appendToValue(cstring chunk)

Appends str to the header field value.

Meta