P4Fix.cpp. #1

  • //
  • guest/
  • YourUncleBob/
  • p4win/
  • main/
  • gui/
  • P4Fix.cpp.
  • View
  • Commits
  • Open Download .zip Download (3 KB)
//
// Copyright 1997 Nicholas J. Irias.  All rights reserved.
//
//

// P4Fix.cpp

#include "stdafx.h"
#include "P4Fix.h"
#include "tokenstring.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif


IMPLEMENT_DYNCREATE(CP4Fix, CObject)


CP4Fix::CP4Fix()
{
	m_Initialized=FALSE;
}

CP4Fix::~CP4Fix()
{
	
}

	
// Eat a row of text from 'P4 fixes' that looks like:
// job000043 fixed by change 3010 on 1997/04/25 by seiwald@lemon
// job000104 fixed by change 3006 on 1997/05/02 by seiwald@lemon
// job000256 fixed by change 3033 on 1997/04/28 by seiwald@lemon
// job000305 fixed by change 3007 on 1997/04/24 by seiwald@lemon
// job000307 fixed by change 3006 on 1997/04/24 by seiwald@lemon
// job000315 fixed by change 3044 on 1997/04/30 by seiwald@lemon

BOOL CP4Fix::Create(LPCTSTR fixesRow)
{
	CTokenString str;
	str.Create(fixesRow);

	m_JobName=str.GetToken();  // Any jobname is valid

	VERIFY(_tcscmp(str.GetToken(), _T("fixed"))==0);   // Skip over word, 'fixed'
	VERIFY(_tcscmp(str.GetToken(), _T("by"))==0);   // Skip over word, 'by'
	VERIFY(_tcscmp(str.GetToken(), _T("change"))==0);   // Skip over word, 'change'

	CString chg= str.GetToken();
	m_ChangeNum= _ttol(chg);
	ASSERT(m_ChangeNum);

	VERIFY(_tcscmp(str.GetToken(), _T("on"))==0);   // Skip over word, 'on'

	m_FixDate=str.GetToken();
	if(m_FixDate.Find(_T("/")) == -1)
		{ ASSERT(0); return FALSE; }

	VERIFY(_tcscmp(str.GetToken(), _T("by"))==0);   // Skip over word, 'by'
	m_User=str.GetToken();     // Any username is valid
	
	m_Initialized=TRUE;
	return TRUE;
}

// Eat a row of text from 'P4 fix' that looks like:
// testjob fixed by change 3255.
BOOL CP4Fix::CreateMyFix(LPCTSTR fixesRow)
{
	CTokenString str;
	str.Create(fixesRow);

	m_JobName=str.GetToken();  // Any jobname is valid

	VERIFY(_tcscmp(str.GetToken(), _T("fixed"))==0);   // Skip over word, 'fixed'
	VERIFY(_tcscmp(str.GetToken(), _T("by"))==0);   // Skip over word, 'by'
	VERIFY(_tcscmp(str.GetToken(), _T("change"))==0);   // Skip over word, 'change'

	CString chg= str.GetToken();
	m_ChangeNum= _ttol(chg);
	ASSERT(m_ChangeNum);

	m_Initialized=TRUE;
	return TRUE;
}

// Eat a row of text from 'P4 fix -d -c change jobname' that looks like:
// Deleted fix testjob by change 3255.
BOOL CP4Fix::CreateFromUnfix(LPCTSTR unfixRow)
{
	CTokenString str;
	str.Create(unfixRow);

	VERIFY(_tcscmp(str.GetToken(), _T("Deleted"))==0);   // Skip over word, 'Deleted'
	VERIFY(_tcscmp(str.GetToken(), _T("fix"))==0);   // Skip over word, 'fix'

	m_JobName=str.GetToken();  // Any jobname is valid
	
	VERIFY(_tcscmp(str.GetToken(), _T("by"))==0);   // Skip over word, 'by'
	VERIFY(_tcscmp(str.GetToken(), _T("change"))==0);   // Skip over word, 'change'

	CString chg= str.GetToken();
	m_ChangeNum= _ttol(chg);
	ASSERT(m_ChangeNum);
	
	m_Initialized=TRUE;
	return TRUE;
}


# Change User Description Committed
#1 19924 YourUncleBob Populate -o //guest/perforce_software/p4win/...
//guest/YourUncleBob/p4win/.....
//guest/perforce_software/p4win/main/gui/P4Fix.cpp
#1 16169 perforce_software Move files to follow new path scheme for branches.
//guest/perforce_software/p4win/gui/P4Fix.cpp
#1 8562 Matt Attaway These feet never stop running.

Initial commit of the P4Win source code.  To the best of our knowledge this
compiles and runs using the 2013.3 P4 API and VS 2010. Expect a few changes
as we refine the build process. Please post any build issues to the forums.