// ClientFileUser.cpp: implementation of the ClientFileUser class.
//
//////////////////////////////////////////////////////////////////////
#include "stdhdrs.h"
#include "strbuf.h"
#include "error.h"
#include "filesys.h"
#include "clientuser.h"
#include "listnode.h"
#include "ClientFileUser.h"
void ClientFileUser::OutputInfo(char level, const_char* data)
{
if (maxresults && (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();
StrBuf ftype = 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.
while (*ptr && *ptr != '(') ptr++; //Move it up to the letter giving the ftype.
ptr++;
ftype.Append(ptr, 1);
files.Append(file); //Add it to the list.
ftypes.Append(ftype);
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 | |
|---|---|---|---|---|---|
| #1 | 7292 | Andrew McDonald | initial submittal | ||
| //guest/sam_stafford/p4hl/src/dlls/ClientFileUser.cpp | |||||
| #5 | 1689 | Sam Stafford |
Integrate 02.1 API and code cleanup to P4HL. Lots of work. Phew. |
||
| #4 | 1024 | Sam Stafford |
Reworked entity creation in most cases - it's done one at a time now rather than all at once. This allows us to have more entities than the previous limit of 130, and also looks a little nicer. Folders and files now pop into existence instantly instead of sliding - makes navigation easier. Depots still slide because there typically aren't as many of them (okay, I might eventually make them pop too, but I'm tired now). Revisions slide because it looks really cool - like a waterfall pouring out of the file. The upper limit to entities is now due to the "visible entity packet" thing, which I'm certain I have no control over - it's as high as it can possibly be right now. |
||
| #3 | 1004 | Sam Stafford |
Different file types are now treated differently - the ObjectFiles have different skins depending on file type of the head rev, and non-text revisions will not attempt to display their contents when expanded. Possible bug: old-style filetypes might be detected wrong (ie "ktext" instead of "text+k"). I'd have to put in some pretty complex logic to make it completely foolproof and backwards-compatible. Right now it just errs on the side of thinking a file is text if there's any confusion. |
||
| #2 | 1003 | Sam Stafford |
Different file types now displayed differently. Also flipped around the file model so that its text doesn't look backwards any more. |
||
| #1 | 937 | Sam Stafford |
Renaming my guest directory to the more conventional sam_stafford. |
||
| //guest/samwise/p4hl/src/dlls/ClientFileUser.cpp | |||||
| #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. |
||