// // Copyright 2000 Perforce Software. All rights reserved. // // This file is part of Perforce - the FAST SCM System. // // p4wTextContentView: // Renders output of print command using mime type determined by file suffix. // ------------------------------------- // Includes // #include <stdio.h> #include <string.h> #include <p4wp4.h> #include "p4wTextContentView.h" #include "p4wMimeContentPane.h" p4wTextContentView::p4wTextContentView(p4wRequest & Request) : p4wMimeContentView(Request) { } p4wTextContentView::~p4wTextContentView() { } // ------------------------------------- // Render this view. // void p4wTextContentView::Render() { // // Request file text at head rev unless we have revision argument. const StrPtr *rev1 = fRequest.GetStateArg( "rev1" ); const StrPtr *srev = fRequest.GetDynArg( "sr" ); const StrPtr *srevState = fRequest.GetStateArg( "sr" ); // // If both dynamic & state parameters for sr are set, dynamic // wins...set srev to winner if( !srev && srevState ) srev = srevState; StrBuf path; path.Set( fRequest.GetPath() ); if( rev1 ) { path << "#" << rev1; } else if( srev ) { path << "@" << srev; } fRequest << "HTTP/1.0 200 OK" << crlf; fRequest << "Content-Type: text/plain" << crlf; fRequest << crlf; p4wMimeContentPane printPane( *this, fRequest ); const char *printPaneArgs[] = { "-q", path.Text() }; fRequest.p4("print", 2, printPaneArgs, &printPane); fRequest.p4Wait(); }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 12234 | Matt Attaway |
Rejigger P4Web project in preparation for official sunsetting The bin directory contains the last official builds of P4Web from the Perforce download site. P4Web is soon to be completely sunsetted; these builds are here for folks who don't want to build their own. To better handle the archived builds the source code has been moved into a separate src directory. |
||
//guest/perforce_software/p4web/Views/p4wTextContentView.cpp | |||||
#1 | 8914 | Matt Attaway | Initial add of the P4Web source code |