ClientDirUser.cpp #3

  • //
  • guest/
  • sam_stafford/
  • p4hl/
  • src/
  • dlls/
  • ClientDirUser.cpp
  • View
  • Commits
  • Open Download .zip Download (1 KB)
// ClientDirUser.cpp: implementation of the ClientDirUser class.
//
//////////////////////////////////////////////////////////////////////

#include "stdhdrs.h"
#include "strbuf.h"
#include "error.h"
#include "filesys.h"
#include "clientuser.h"
#include "listnode.h"
#include "ClientDirUser.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

void ClientDirUser::OutputInfo(char level, const_char* data)
{
	if (maxresults && (results > maxresults)) return;
	if (changeflag == TRUE)
	{
		OutputChanges(data);
		return;
	}
	/* Each line of output is a directory name; for example:
	 * //depot/foo/bar
	 * Very little needs to be done in the way of parsing. */
	StrBuf dir = StrBuf();
	dir.Append(data); //Put all the output into this StrBuf
	dirs.Append(dir); //and append it to the list.
	results++;
}

void ClientDirUser::OutputChanges(const_char * data)
{
	StrBuf change = StrBuf();
	change.Append(data);
	if (change.Length() > 78) change.SetLength(78); //Truncate output over 78 chars - space is valuable.
	change.Append("\n"); //This function is called once per line, and the data doesn't include a newline.
	changes.Append(&change); //Note that changes is a StrBuf, not a ListList.
}

ClientDirUser::ClientDirUser()
{
	results = 0;
}

ClientDirUser::~ClientDirUser()
{

}
# Change User Description Committed
#3 1689 Sam Stafford Integrate 02.1 API and code cleanup to P4HL.
 Lots of work.  Phew.
#2 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.
#1 937 Sam Stafford Renaming my guest directory to the more conventional
sam_stafford.
//guest/samwise/p4hl/src/dlls/ClientDirUser.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.