Google APIs Client Library for C++
HtmlScribe Class Reference

Specialized HttpScribe that produces HTML transcripts. More...

#include "client/transport/html_scribe.h"

+ Inheritance diagram for HtmlScribe:

List of all members.

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 EntryNewEntry (const HttpRequest *request)
 Returns an entry that produces the individual HTML transcript for the request.

Detailed Description

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.


Member Enumeration Documentation

Enumerator:
EXPANDABLE_REQUEST 
EXPANDABLE_HEADERS 
EXPANDABLE_REQUEST_CONTENT 
EXPANDABLE_RESPONSE_BODY 
COLORIZE 
ALL 

Constructor & Destructor Documentation

HtmlScribe ( HttpScribeCensor censor,
const StringPiece &  title,
DataWriter writer 
)

Constructor.

Parameters:
[in]censorThe censor to use for scrubbing sensitive data. The caller passes ownership.
[in]titleFor the HTML document title.
[in]writerOwnership 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.


Member Function Documentation

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.

Returns:
bitwise or value of individual enum values.
See also:
PresentationFlags
void set_presentation_flags ( int  flags) [inline]

Controls features in HTML output.

Parameters:
[in]flagsBitwise-or of PresentationFlags enum values.

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines