StdAir Logo  1.00.13
C++ Standard Airline IT Object Library
Loading...
Searching...
No Matches
ProgressStatus.cpp
Go to the documentation of this file.
1// //////////////////////////////////////////////////////////////////////
2// Import section
3// //////////////////////////////////////////////////////////////////////
4// STL
5#include <cassert>
6#include <sstream>
7// StdAir
11
12namespace stdair {
13
14 // //////////////////////////////////////////////////////////////////////
16 const Count_T& iExpectedNb,
17 const Count_T& iActualNb)
18 : _currentNb (iCurrentNb),
19 _expectedNb (iExpectedNb), _actualNb (iActualNb) {
20 }
21
22 // //////////////////////////////////////////////////////////////////////
24 const Count_T& iActualNb)
25 : _currentNb (DEFAULT_PROGRESS_STATUS),
26 _expectedNb (iExpectedNb), _actualNb (iActualNb) {
27 }
28
29 // //////////////////////////////////////////////////////////////////////
31 : _currentNb (DEFAULT_PROGRESS_STATUS),
32 _expectedNb (iExpectedNb), _actualNb (iExpectedNb) {
33 }
34
35 // //////////////////////////////////////////////////////////////////////
41
42 // //////////////////////////////////////////////////////////////////////
44 : _currentNb (iProgressStatus._currentNb),
45 _expectedNb (iProgressStatus._expectedNb),
46 _actualNb (iProgressStatus._actualNb) {
47 }
48
49 // //////////////////////////////////////////////////////////////////////
51 _currentNb = DEFAULT_PROGRESS_STATUS;
52 _actualNb = DEFAULT_PROGRESS_STATUS;
53 }
54
55 // //////////////////////////////////////////////////////////////////////
56 const std::string ProgressStatus::describe() const {
57 std::ostringstream oStr;
58 oStr << _currentNb << " / {" << _expectedNb << ", " << _actualNb << "}";
59 return oStr.str();
60 }
61
62 // //////////////////////////////////////////////////////////////////////
63 const std::string ProgressStatus::toString() const {
64 std::ostringstream oStr;
65 oStr << std::setprecision (3) << progress()
66 << "% (" << _currentNb << "/" << _actualNb << ")";
67 return oStr.str();
68 }
69
70}
Handle on the StdAir library context.
const Count_T DEFAULT_PROGRESS_STATUS
unsigned int Count_T
const std::string toString() const
const ProgressPercentage_T progress() const
const std::string describe() const