Google APIs Client Library for C++
|
Specialized HttpScribe that produces HTML transcripts. More...
#include "client/transport/html_scribe.h"
Public Types | |
enum | PresentationFlags { EXPANDABLE_REQUEST = 0x1, EXPANDABLE_HEADERS = 0x2, EXPANDABLE_REQUEST_CONTENT = 0x4, EXPANDABLE_RESPONSE_BODY = 0x8, COLORIZE = 0x10, ALL } |
Public Member Functions | |
HtmlScribe (HttpScribeCensor *censor, const StringPiece &title, DataWriter *writer) | |
Constructor. | |
virtual | ~HtmlScribe () |
Standard destructor. | |
virtual void | Checkpoint () |
Flushes the writer, but does not "finish out" the HTML to make it well formed. | |
void | set_presentation_flags (int flags) |
Controls features in HTML output. | |
int | presentation_flags () const |
Returns the presentation flags. | |
bool | expand_request () const |
Returns true if requests are expandable in the HTML. | |
bool | expand_headers () const |
Returns true if headers are expandable in the HTML. | |
bool | expand_request_content () const |
Returns true if the request content is expandable in the HTML. | |
bool | expand_response_body () const |
Returns true if the response body is expandable in the HTML. | |
Protected Member Functions | |
virtual Entry * | NewEntry (const HttpRequest *request) |
Returns an entry that produces the individual HTML transcript for the request. |
Specialized HttpScribe that produces HTML transcripts.
The PresentationFlags enumeration allows you to control the structure of the HTML produced. Depending on how you plan on browsing the HTML, the choice can make it easier or harder due to the abstractions they control.
If you want to copy and paste sequences of requests then you might want to turn the all off. If you want to browse the sequence and only look at header or playload details then you should just set those flags.
You can use the base class scribe's max_snippet attribute to limit how much request/response data you store for each request. Since everything is going to be journaled into a single HTML document, this could be a good idea if you are performing large media transfers!
The implementation of this class may stream directly to the writer, in which case it may not be well-formed HTML if it did not finish properly (e.g. it is still scribing or the process crashed). If that is the case, you may need to append the closing tags to make it well formed if you need to have well formed HTML.
enum PresentationFlags |
HtmlScribe | ( | HttpScribeCensor * | censor, |
const StringPiece & | title, | ||
DataWriter * | writer | ||
) |
Constructor.
[in] | censor | The censor to use for scrubbing sensitive data. The caller passes ownership. |
[in] | title | For the HTML document title. |
[in] | writer | Ownership is passed to the scribe. This writer will store the transcript. |
virtual ~HtmlScribe | ( | ) | [virtual] |
Standard destructor.
This will finish out the HTML and flush the writer to make it a well-formed document.
virtual void Checkpoint | ( | ) | [virtual] |
Flushes the writer, but does not "finish out" the HTML to make it well formed.
Implements HttpScribe.
bool expand_headers | ( | ) | const [inline] |
Returns true if headers are expandable in the HTML.
bool expand_request | ( | ) | const [inline] |
Returns true if requests are expandable in the HTML.
bool expand_request_content | ( | ) | const [inline] |
Returns true if the request content is expandable in the HTML.
bool expand_response_body | ( | ) | const [inline] |
Returns true if the response body is expandable in the HTML.
virtual Entry* NewEntry | ( | const HttpRequest * | request | ) | [protected, virtual] |
Returns an entry that produces the individual HTML transcript for the request.
Implements HttpEntryScribe.
int presentation_flags | ( | ) | const [inline] |
Returns the presentation flags.
void set_presentation_flags | ( | int | flags | ) | [inline] |
Controls features in HTML output.
[in] | flags | Bitwise-or of PresentationFlags enum values. |