"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/lib/shared/SerialKey.h" between
synergy-core-1.14.4.37-stable.tar.gz and synergy-core-1.14.5.13-stable.tar.gz

About: Synergy is software for sharing one mouse and one keyboard between multiple computers on your desk allowing to seamlessly move the mouse cursor from one screen to another (works on Linux, Windows and Mac OS X). Synergy 1.

SerialKey.h  (synergy-core-1.14.4.37-stable):SerialKey.h  (synergy-core-1.14.5.13-stable)
skipping to change at line 22 skipping to change at line 22
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#pragma once #pragma once
#include <string> #include <string>
#include <ctime> #include <ctime>
#include "EditionType.h" #include "SerialKeyData.h"
#include "SerialKeyType.h"
#include "SerialKeyEdition.h" #include "SerialKeyEdition.h"
#ifdef TEST_ENV
#include <gtest/gtest_prod.h>
#endif
class SerialKey { class SerialKey {
friend bool operator== (SerialKey const&, SerialKey const&); friend bool operator== (SerialKey const&, SerialKey const&);
public: public:
explicit SerialKey(Edition edition = kUnregistered); explicit SerialKey(Edition edition = kUnregistered);
explicit SerialKey(std::string serial); explicit SerialKey(const std::string& serial);
bool isExpiring(time_t currentTime) const; bool isExpiring(time_t currentTime) const;
bool isExpired(time_t currentTime) const; bool isExpired(time_t currentTime) const;
bool isTrial() const; bool isTrial() const;
bool isTemporary() const; bool isTemporary() const;
bool isMaintenance() const;
bool isValid() const; bool isValid() const;
time_t daysLeft(time_t currentTime) const; time_t daysLeft(time_t currentTime) const;
time_t getExpiration() const;
int getSpanLeft(time_t time = ::time(0)) const; int getSpanLeft(time_t time = ::time(0)) const;
std::string email() const;
Edition edition() const; Edition edition() const;
std::string toString() const; const std::string& toString() const;
static std::string decode(const std::string& serial);
private: private:
bool parse(std::string plainSerial); SerialKeyData m_data;
#ifdef TEST_ENV
private:
FRIEND_TEST(SerialKeyTests, parse_noParty_invalid);
FRIEND_TEST(SerialKeyTests, parse_invalidPartsLenghth_invalid);
FRIEND_TEST(SerialKeyTests, parse_validV1Serial_valid);
FRIEND_TEST(SerialKeyTests, parse_validV2Serial_valid);
#endif
private:
std::string m_name;
std::string m_email;
std::string m_company;
unsigned m_userLimit;
unsigned long long m_warnTime;
unsigned long long m_expireTime;
SerialKeyEdition m_edition;
SerialKeyType m_KeyType;
}; };
inline bool inline bool
operator== (SerialKey const& lhs, SerialKey const& rhs) { operator== (SerialKey const& lhs, SerialKey const& rhs) {
return (lhs.m_name == rhs.m_name) && return (lhs.m_data == rhs.m_data);
(lhs.m_email == rhs.m_email) &&
(lhs.m_company == rhs.m_company) &&
(lhs.m_userLimit == rhs.m_userLimit) &&
(lhs.m_warnTime == rhs.m_warnTime) &&
(lhs.m_expireTime == rhs.m_expireTime) &&
(lhs.m_edition == rhs.m_edition) &&
(lhs.m_KeyType == rhs.m_KeyType);
} }
inline bool inline bool
operator!= (SerialKey const& lhs, SerialKey const& rhs) { operator!= (SerialKey const& lhs, SerialKey const& rhs) {
return !(lhs == rhs); return !(lhs == rhs);
} }
 End of changes. 10 change blocks. 
37 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)