/* Copyright (c) 1997-2004, Perforce Software, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL PERFORCE SOFTWARE, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * Defines the ClientUser derived class used by the perl interface */ class ClientUserPerl : public ClientUser { public: ClientUserPerl( SV * perlUI ); virtual void ErrorPause( char *errBuf, Error *e ); virtual void HandleError( Error *err ); virtual void InputData( StrBuf *strbuf, Error *e ); virtual void OutputError( char *errBuf ); virtual void OutputInfo( char level, const_char *data ); virtual void OutputStat( StrDict *varList ); virtual void OutputText( const_char *data, int length ); virtual void OutputBinary( const_char *data, int length ); virtual void Prompt( const StrPtr &msg, StrBuf &rsp, int noEcho, Error *e ); virtual void Edit( FileSys *f1, Error *e ); virtual void Diff( FileSys *f1, FileSys *f2, int doPage, char *diffFlags, Error *e ); void DebugLevel( int d ) { debug = d; } void DoPerlDiffs( int flag ) { perlDiffs = flag; } private: void DictToHash( StrDict *d, HV *hv ); void SplitKey( const StrPtr *key, StrBuf &base, StrBuf &index ); void InsertItem( HV *hv, const StrPtr *var, const StrPtr *val ); void HashToForm( HV *hv, StrBuf *b ); HV * FlattenHash( HV *hv ); private: SV* perlUI; int debug; int perlDiffs; };
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#7 | 4158 | Tony Smith |
Copyright notice updates. No functional change. |
||
#6 | 3550 | Tony Smith |
Add OutputBinary() support to P4Perl. This allows "p4 print" to work with clients that do not use "local" line endings amongst other things. |
||
#5 | 2223 | Tony Smith |
Relegated previous support for "p4 diff" to the bottom drawer and use the Diff class provided in the P4 API to send the diff listings through the OutputText() interface. This has two main advantages over the old implementation: (a) same output as "p4 diff" as it uses the same classes and (b) doesn't require extra perl modules. The old implementation is still available - you just have to call P4::Client::DoPerlDiffs() to specify your preference. |
||
#4 | 1980 | Tony Smith |
Porting changes. Make P4/Perl build with ActivePerl > 623. They've messed up the PerlIO headers now so you can't use fprintf in an XSUB anymore. Also they're now including math.h and on Windows that must be included with C++ linkage so we now include it before we include the other perl headers that have to be included with C linkage. |
||
#3 | 1976 | Tony Smith |
Add support for ClientUser::Diff() to P4/Perl. Uses the Algorithm::Diff module to perform the diffs. Thanks to Wilson Snyder. |
||
#2 | 1615 | Tony Smith |
Add debugging support to the ClientUserPerl class. It's not complete, but it's targeted at the code which deals with tagged output parsing which is the most complex code by far. |
||
#1 | 1011 | Tony Smith |
Moved Perl API stuff one level down to make way for upcoming Ruby interface. |
||
//guest/tony_smith/perforce/API/P4-Client/lib/clientuserperl.h | |||||
#1 | 549 | Tony Smith |
Renamed the working directory to P4-Client as I've discovered that MakeMaker is quite happy with that and doesn't require a version number in the directory name. |
||
//guest/tony_smith/perforce/API/P4-Client-0.51/lib/clientuserperl.h | |||||
#1 | 527 | Tony Smith | Release P4::Client version 0.51 with Win32 support | ||
//guest/tony_smith/perforce/API/P4-Client-0.50/lib/clientuserperl.h | |||||
#1 | 509 | Tony Smith |
Renamed P4::ClientApi to P4::Client as it's more friendly and that's what it's called on CPAN. Subsequent changes include the actual renaming inside the code, this just creates the branch |
||
//guest/tony_smith/perforce/API/P4-ClientApi-0.05/lib/clientuserperl.h | |||||
#1 | 501 | Tony Smith |
First publicly released version of the Perl interface to the Perforce API. |