-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for character vector for na values. Closes #13
- Loading branch information
Jonathan Marshall
committed
Apr 10, 2015
1 parent
5ef0ca5
commit 2dd82d6
Showing
9 changed files
with
65 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#ifndef READXL_STRINGSET_ | ||
#define READXL_STRINGSET_ | ||
|
||
#include <Rcpp.h> | ||
|
||
class StringSet | ||
{ | ||
std::set<std::string> set_; | ||
public: | ||
StringSet(const char *s = "") { | ||
if (strlen(s) > 0) | ||
set_.insert(s); | ||
} | ||
StringSet(const std::vector<std::string> &s) { | ||
for (std::vector<std::string>::const_iterator i = s.begin(); i != s.end(); ++i) | ||
set_.insert(*i); | ||
} | ||
StringSet(const Rcpp::CharacterVector &s) { | ||
for (Rcpp::CharacterVector::const_iterator i = s.begin(); i != s.end(); ++i) | ||
set_.insert(Rcpp::as<std::string>(*i)); | ||
} | ||
bool contains(const std::string &s) const { | ||
return set_.find(s) != set_.end(); | ||
} | ||
bool contains(const double d) const { | ||
std::ostringstream str; str << d; | ||
return contains(str.str()); | ||
} | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters