#ifndef PAIRTIMELIST_H
#define PAIRTIMELIST_H
#include <QList>
#include <QString>
#include <QStringList>
#include <QTime>
#include <QPair>
class PairTimeList
{
public:
PairTimeList();
PairTimeList( QList< QPair<QString, QTime> > list);
bool contains
(const QString key
) const;
bool contains(const QPair<QString, QTime> pair) const;
bool insert(const QPair<QString, QTime> pair);
bool erase(const QPair<QString, QTime> pair);
bool erase(int position);
void clear();
void removeFirst();
void removeLast();
bool replace(int position, const QPair<QString, QTime> newpair);
int position
(const QString key
) const;
//return -1 if key doesn't exists QPair<QString, QTime> data(int position) const;
const QPair<QString, QTime> at(int position) const;
QList<QTime> times() const;
QStringList keys
(const QTime value
);
//return all keys(QString) with QTime=value const QList< QPair<QString, QTime> > sort_byTime() ; //BubbleSort
const QList< QPair<QString, QTime> > sort_byStrings(); //BubbleSort
const QList< QPair<QString, QTime> > getList() const ;
int size() const;
void setTime
(int position,
QTime t
);
void setTime(int position, int h, int min, int sec=0, int msec=0);
void setTime
(const QString key,
int h,
int min,
int sec
=0,
int msec
=0);
void addSec(int position, int sectoAdd);
void addSec
(const QString key,
int sectoAdd
);
void addMsec(int position, int msecToAdd);
void addMsec
(const QString key,
int msecToAdd
);
QTime deltaTime
(int from1,
int to2
);
int msecBetween(int position1, int position2);
int secBetween(int position1, int position2);
private:
QList< QPair<QString, QTime> > mylist;
};
#endif // PAIRTIMELIST_H
#ifndef PAIRTIMELIST_H
#define PAIRTIMELIST_H
#include <QList>
#include <QString>
#include <QStringList>
#include <QTime>
#include <QPair>
class PairTimeList
{
public:
PairTimeList();
PairTimeList( QList< QPair<QString, QTime> > list);
bool contains(const QString key) const;
bool contains(const QPair<QString, QTime> pair) const;
bool insert(const QString str, const QTime t);
bool insert(const QPair<QString, QTime> pair);
bool erase(const QString key);
bool erase(const QPair<QString, QTime> pair);
bool erase(int position);
void clear();
void removeFirst();
void removeLast();
bool replace(int position, const QPair<QString, QTime> newpair);
bool replace(const QString key, const QTime newTime);
int position(const QString key) const; //return -1 if key doesn't exists
QPair<QString, QTime> data(int position) const;
const QPair<QString, QTime> at(int position) const;
QTime time(const QString key) const;
QList<QTime> times() const;
QStringList keys();
QStringList keys(const QTime value); //return all keys(QString) with QTime=value
QStringList keysBetween(const QTime fromTime, const QTime toTime);
const QList< QPair<QString, QTime> > sort_byTime() ; //BubbleSort
const QList< QPair<QString, QTime> > sort_byStrings(); //BubbleSort
const QList< QPair<QString, QTime> > getList() const ;
QString print();
int size() const;
void setTime(int position, QTime t);
void setTime(int position, int h, int min, int sec=0, int msec=0);
void setTime(const QString key, QTime t);
void setTime(const QString key, int h, int min, int sec=0, int msec=0);
void addSec(int position, int sectoAdd);
void addSec(const QString key, int sectoAdd);
void addMsec(int position, int msecToAdd);
void addMsec(const QString key, int msecToAdd);
QTime deltaTime(int from1, int to2);
int msecBetween(int position1, int position2);
int msecBetween(const QString key1, QString key2);
int secBetween(int position1, int position2);
int secBetween(const QString key1, QString key2);
private:
QList< QPair<QString, QTime> > mylist;
};
#endif // PAIRTIMELIST_H
To copy to clipboard, switch view to plain text mode
Bookmarks