// ClientFileUser.cpp: implementation of the ClientFileUser class.
//
//////////////////////////////////////////////////////////////////////
#include "ClientFileUser.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
void ClientFileUser::OutputInfo(char level, const_char* data)
{
if (results > MAXRESULTS) return;
if (logflag)
{
OutputLog(level, data);
return;
}
/* A line of output from "p4 files" looks like this:
* //depot/foo/bar.c#3 - edit change 123 (text)
* For our purposes we care about everything before the revision specifier (#).
* If the file is a "delete", don't bother adding it to the list. */
StrBuf file = StrBuf();
char* ptr = (char*) data;
while (*ptr && *ptr != '#') //As long as this character isn't null or #
{
file.Append(ptr, 1); //add it to the filename StrBuf.
ptr++;
}
if (*ptr == '\0') return; //If the loop stopped because we hit a null, return.
while (*ptr && *ptr != ' ') ptr++; //Move up to the next space (before the dash).
ptr+=3; //Skip ahead to the first letter of the word describing this revision.
if (*ptr == 'd') return; //If the file is a delete, ignore it.
files.Append(file); //Otherwise, add it to the list.
results++;
}
/*This method is quite similar to ClientDirUser::Changes - see that method's comments. */
void ClientFileUser::OutputLog(char level, const_char* data)
{
if (level != '1') return; //Ignore levels 0 (file name) and 2 (integ records).
StrBuf entry = StrBuf();
entry.Append(data);
if (entry.Length() > 78) entry.SetLength(78);
entry.Append("\n");
filelog.Append(&entry);
results++;
return;
}
ClientFileUser::ClientFileUser()
{
results=0;
}
ClientFileUser::~ClientFileUser()
{
}
| # | Change | User | Description | Committed | |
|---|---|---|---|---|---|
| #2 | 937 | Sam Stafford |
Renaming my guest directory to the more conventional sam_stafford. |
||
| #1 | 936 | Sam Stafford |
Adding P4HL to the public depot. See relnotes.txt for installation instructions; all relevant files are under p4hl/dist. Source code is under p4hl/src in the form of a VC++ project. |