/* * Copyright 1995, 2011 Perforce Software. All rights reserved. * * This file is part of Perforce - the FAST SCM System. */ # include <stdhdrs.h> # include <strbuf.h> # include <timer.h> # include <progress.h> ProgressReport::ProgressReport() { fieldChanged = CP_NEW; units = 0; total = -1; position = 0; lastReportedPosition = 0; needfinal = 0; tm.Start(); } ProgressReport::~ProgressReport() { if( needfinal ) DoReport( CPP_FAILDONE ); } void ProgressReport::Description( const StrPtr &d ) { description = d; fieldChanged |= CP_DESC; } void ProgressReport::Units( int u ) { units = u; fieldChanged |= CP_UNITS; } void ProgressReport::Total( long t ) { total = t; fieldChanged |= CP_TOTAL; } void ProgressReport::Position( long p, int flag ) { if( p != position ) { position = p; fieldChanged |= CP_POS; } ConsiderReport( flag ); } void ProgressReport::Increment( long p, int flag ) { if( p != 0 ) { position += p; fieldChanged |= CP_POS; } ConsiderReport( flag ); } void ProgressReport::ConsiderReport( int flag ) { if( flag == CPP_NORMAL ) { int tim = tm.Time(); if( tim < 500 ) return; tm.Restart(); } DoReport( flag ); } void ProgressReport::DoReport( int flag ) { }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 14945 | Newtopian |
Merging //guest/perforce_software/p4/... to //guest/Newtopian/p4/... |
||
//guest/perforce_software/p4/2014.1/support/progress.cc | |||||
#1 | 12188 | Matt Attaway | Move 'main' p4 into a release specific directory in prep for new releases | ||
//guest/perforce_software/p4/support/progress.cc | |||||
#1 | 9129 | Matt Attaway | Initial commit of the 2014.1 p4/p4api source code |