Skip to content

Commit 3400c06

Browse files
committed
Types tidy-up
1 parent cc77007 commit 3400c06

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

src/RcppExports.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -94,34 +94,34 @@ BEGIN_RCPP
9494
END_RCPP
9595
}
9696
// doc_format
97-
CharacterVector doc_format(XPtr<xmlDoc> x);
97+
CharacterVector doc_format(XPtrDoc x);
9898
RcppExport SEXP xml2_doc_format(SEXP xSEXP) {
9999
BEGIN_RCPP
100100
Rcpp::RObject __result;
101101
Rcpp::RNGScope __rngScope;
102-
Rcpp::traits::input_parameter< XPtr<xmlDoc> >::type x(xSEXP);
102+
Rcpp::traits::input_parameter< XPtrDoc >::type x(xSEXP);
103103
__result = Rcpp::wrap(doc_format(x));
104104
return __result;
105105
END_RCPP
106106
}
107107
// doc_write
108-
void doc_write(XPtr<xmlDoc> x, std::string path);
108+
void doc_write(XPtrDoc x, std::string path);
109109
RcppExport SEXP xml2_doc_write(SEXP xSEXP, SEXP pathSEXP) {
110110
BEGIN_RCPP
111111
Rcpp::RNGScope __rngScope;
112-
Rcpp::traits::input_parameter< XPtr<xmlDoc> >::type x(xSEXP);
112+
Rcpp::traits::input_parameter< XPtrDoc >::type x(xSEXP);
113113
Rcpp::traits::input_parameter< std::string >::type path(pathSEXP);
114114
doc_write(x, path);
115115
return R_NilValue;
116116
END_RCPP
117117
}
118118
// doc_root
119-
XPtrNode doc_root(XPtr<xmlDoc> x);
119+
XPtrNode doc_root(XPtrDoc x);
120120
RcppExport SEXP xml2_doc_root(SEXP xSEXP) {
121121
BEGIN_RCPP
122122
Rcpp::RObject __result;
123123
Rcpp::RNGScope __rngScope;
124-
Rcpp::traits::input_parameter< XPtr<xmlDoc> >::type x(xSEXP);
124+
Rcpp::traits::input_parameter< XPtrDoc >::type x(xSEXP);
125125
__result = Rcpp::wrap(doc_root(x));
126126
return __result;
127127
END_RCPP

src/xml2_doc.cpp

+4-7
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ XPtrDoc doc_parse_string(CharacterVector x, std::string encoding,
6666
}
6767

6868
// [[Rcpp::export]]
69-
CharacterVector doc_format(XPtr<xmlDoc> x) {
69+
CharacterVector doc_format(XPtrDoc x) {
7070
xmlChar *s;
7171
xmlDocDumpMemory(x.get(), &s, NULL);
7272

@@ -77,7 +77,7 @@ CharacterVector doc_format(XPtr<xmlDoc> x) {
7777
}
7878

7979
// [[Rcpp::export]]
80-
void doc_write(XPtr<xmlDoc> x, std::string path) {
80+
void doc_write(XPtrDoc x, std::string path) {
8181
FILE* f = fopen(path.c_str(), "wb");
8282

8383
int res = xmlDocDump(f, x.get());
@@ -88,11 +88,8 @@ void doc_write(XPtr<xmlDoc> x, std::string path) {
8888
}
8989
}
9090

91-
9291
// [[Rcpp::export]]
93-
XPtrNode doc_root(XPtr<xmlDoc> x) {
94-
xmlNode* root = xmlDocGetRootElement(x.get());
95-
96-
return XPtrNode(root);
92+
XPtrNode doc_root(XPtrDoc x) {
93+
return XPtrNode(xmlDocGetRootElement(x.get()));
9794
}
9895

0 commit comments

Comments
 (0)