File tree Expand file tree Collapse file tree 4 files changed +27
-1
lines changed
include/Rcpp/date_datetime Expand file tree Collapse file tree 4 files changed +27
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
* inst/include/Rcpp/date_datetime/Date.h (format, operator<<): Added
4
4
* inst/include/Rcpp/date_datetime/Datetime.h (format, operator<<): Ditto
5
+ * inst/include/Rcpp/date_datetime/newDateVector.h (operator<<): Ditto
6
+ * inst/include/Rcpp/date_datetime/newDatetimeVector.h (operator<<): Ditto
5
7
6
8
2016-11-23 Dirk Eddelbuettel <
[email protected] >
7
9
Original file line number Diff line number Diff line change 8
8
\itemize {
9
9
\item The exception stack message is now correctly demangled on all
10
10
compiler versions (Jim Hester in \ghpr {598 })
11
- \item Date and Datetime object now have format methods
11
+ \item Date and Datetime object and vector now have format methods and
12
+ \code {operator << } support (PR \ghpr {599 })
12
13
}
13
14
\item Changes in Rcpp unit tests
14
15
\itemize {
Original file line number Diff line number Diff line change @@ -52,13 +52,24 @@ namespace Rcpp {
52
52
return *this ;
53
53
}
54
54
55
+ friend inline std::ostream &operator <<(std::ostream & s, const newDateVector d);
56
+
55
57
private:
56
58
57
59
void setClass () {
58
60
Shield<SEXP> dateclass (Rf_mkString (" Date" ));
59
61
Rf_setAttrib (*this , R_ClassSymbol, dateclass);
60
62
}
61
63
};
64
+
65
+ inline std::ostream &operator <<(std::ostream & os, const newDateVector d) {
66
+ int n = d.size ();
67
+ for (int i=0 ; i<n; i++) {
68
+ os << Date (d[i]).format () << " " ;
69
+ if ((i+1 ) % 8 == 0 ) os << " \n " ;
70
+ }
71
+ return os;
72
+ }
62
73
}
63
74
64
75
#endif
Original file line number Diff line number Diff line change @@ -61,6 +61,8 @@ namespace Rcpp {
61
61
return *this ;
62
62
}
63
63
64
+ friend inline std::ostream &operator <<(std::ostream & s, const newDatetimeVector d);
65
+
64
66
private:
65
67
66
68
void setClass (const char *tz) {
@@ -75,6 +77,16 @@ namespace Rcpp {
75
77
}
76
78
}
77
79
};
80
+
81
+ inline std::ostream &operator <<(std::ostream & os, const newDatetimeVector d) {
82
+ int n = d.size ();
83
+ for (int i=0 ; i<n; i++) {
84
+ os << Datetime (d[i]).format () << " " ;
85
+ if ((i+1 ) % 4 == 0 ) os << " \n " ;
86
+ }
87
+ return os;
88
+ }
89
+
78
90
}
79
91
80
92
#endif
You can’t perform that action at this time.
0 commit comments