1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/nsprpub/pr/src/cplus/rctime.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,34 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +/* 1.10 +** Class implementation for calendar time routines (ref: prtime.h) 1.11 +*/ 1.12 + 1.13 +#include "rctime.h" 1.14 + 1.15 +RCTime::~RCTime() { } 1.16 + 1.17 +RCTime::RCTime(PRTime time): RCBase() { gmt = time; } 1.18 +RCTime::RCTime(const RCTime& his): RCBase() { gmt = his.gmt; } 1.19 +RCTime::RCTime(RCTime::Current): RCBase() { gmt = PR_Now(); } 1.20 +RCTime::RCTime(const PRExplodedTime& time): RCBase() 1.21 +{ gmt = PR_ImplodeTime(&time); } 1.22 + 1.23 +void RCTime::operator=(const PRExplodedTime& time) 1.24 +{ gmt = PR_ImplodeTime(&time); } 1.25 + 1.26 +RCTime RCTime::operator+(const RCTime& his) 1.27 +{ RCTime sum(gmt + his.gmt); return sum; } 1.28 + 1.29 +RCTime RCTime::operator-(const RCTime& his) 1.30 +{ RCTime difference(gmt - his.gmt); return difference; } 1.31 + 1.32 +RCTime RCTime::operator/(PRUint64 his) 1.33 +{ RCTime quotient(gmt / gmt); return quotient; } 1.34 + 1.35 +RCTime RCTime::operator*(PRUint64 his) 1.36 +{ RCTime product(gmt * his); return product; } 1.37 +