Helix Web Services Client  1
Helix Web Services Client SDK for Qt Applications
Session.h
1 #ifndef __HWS_SESSION_H__
2 #define __HWS_SESSION_H__
3 
4 #include <QByteArray>
5 #include <QJsonDocument>
6 #include <QString>
7 #include <QSharedPointer>
8 #include <QUrl>
9 
10 #include <QDebug>
11 
12 namespace hws
13 {
22  class Session
23  {
24  public:
26  Session();
27 
29  Session(const Session & s);
30 
32  ~Session();
33 
35  Session & operator=(const Session & s);
36 
39  const QUrl & url() const;
40 
42  void setUrl(const QUrl & url);
43 
45  const QString & user() const;
46 
48  void setUser(const QString & user);
49 
52  const QString & p4Ticket() const;
53 
55  void setP4Ticket(const QString & ticket);
56 
58  QString toString()
59  {
60  return QString("Session [url=%1] [user=%2]")
61  .arg(mUrl.toString())
62  .arg(mUser);
63  }
64 
65  private:
66  QUrl mUrl;
67  QString mUser;
68  QString mTicket;
69  };
70 
71  typedef QSharedPointer<Session> SessionPtr;
72 }
73 
74 #endif // __HWS_SESSION_H__
void setUser(const QString &user)
Set the Perforce login name.
Definition: Session.cpp:50
Definition: hws.h:63
The HWS Session, that owns our security token.
Definition: Session.h:22
const QUrl & url() const
Definition: Session.cpp:35
const QString & p4Ticket() const
Definition: Session.cpp:55
~Session()
Typical destructor.
Definition: Session.cpp:22
Session()
New empty session.
Definition: Session.cpp:8
void setUrl(const QUrl &url)
Set the Helix Web Services URL.
Definition: Session.cpp:40
const QString & user() const
The Perforce login associated with this session.
Definition: Session.cpp:45
Session & operator=(const Session &s)
Copy session state from an existing session.
Definition: Session.cpp:26
void setP4Ticket(const QString &ticket)
Set the P4 ticket to be used by the client.
Definition: Session.cpp:60
QString toString()
Debugging representation of the Session.
Definition: Session.h:58