21 #ifndef _GLIBCXX_VECTOR
24 #ifndef _GLIBCXX_STRING
27 #ifndef _GLIBCXX_CSTDLIB
31 #define xf_assert(cond) arb_assert(cond)
92 void detectSingleField() { single_field = fields.find_first_of(
';') == string::npos; }
99 ReadRule(
const string& fields_,
const string& separator_) :
101 separator(separator_)
105 ReadRule(
const char *fields_,
const char *separator_,
const char *aci_) :
107 separator(separator_),
114 const string&
getACI()
const {
return aci; }
125 mutable bool isValidKey;
139 targetType(forceType),
149 else isValidKey =
true;
159 targetType = forceType;
171 bool precision_loss_permitted;
177 precision_loss_permitted(
false)
187 rule->setTargetType(forceType);
192 return precision_loss_permitted;
196 precision_loss_permitted =
true;
199 rule->permitPrecisionLoss();
220 bool transferUndefFields;
225 bool empty()
const {
return rules.empty(); }
226 size_t size()
const {
return rules.size(); }
229 void add(RulePtr rule) { rules.push_back(rule); }
235 const Rule&
get(
int idx)
const {
246 rules.erase(rules.begin()+idx);
250 rules.insert(rules.begin()+idx, rule);
258 void setComment(
const string& newComment) { comment = newComment; }
267 static ErrorOrRuleSetPtr
loadFrom(
const char *filename);
301 #if defined(ASSERTION_USED)
302 mutable bool checked4error;
303 mutable bool userCallbackUsed;
306 static string lastReportedError;
310 GB_ERROR copySubIfMissing(
const char *subName);
312 const char *get_id_field()
const;
320 #if defined(ASSERTION_USED)
321 checked4error =
true;
323 return !errorCopy.empty();
329 lastReportedError = errorCopy;
330 return lastReportedError.c_str();
343 #error xferset.h included twice
bool validIdx(int idx) const
const string & getACI() const
bool multiple_source_fields() const
return string(buffer, length)
GB_TYPES getTargetType() const
static RulePtr forceTargetType(GB_TYPES forceType, RulePtr rule)
static RulePtr permitPrecisionLoss(RulePtr rule)
string getShortDescription() const
const char * GBS_global_string(const char *templat,...)
const string & getSeparator() const
TransportedData(const string &s)
SmartPtr< RuleSet > RuleSetPtr
static TransportedData none()
int insertBefore(int idx, RulePtr rule)
void setTargetType(GB_TYPES forceType)
void permitPrecisionLoss()
__ATTR__USERESULT GB_ERROR saveTo(const char *filename) const
WriteRule(const string &name_)
GB_ERROR GB_check_hkey(const char *key) __ATTR__USERESULT
__ATTR__USERESULT GB_ERROR transferBy(GBDATA *gb_source, GBDATA *gb_dest) const
bool isSet() const
test if SmartPtr is not NULp
static RulePtr makeSimple(const string &src, const string &sep, const string &dest)
void saveReadConfig(ConfigMapping &cfgmap) const
virtual ~AlignmentTransporter()
const string & targetField() const
bool shallTransferUndefFields() const
static void error(const char *msg)
const string & getString() const
const string & getComment() const
Rule(const ReadRule &howRead, const WriteRule &howWrite)
void setComment(const string &newComment)
RuleContainer::const_iterator RuleIterator
GB_ERROR check_hkey() const
static ErrorOrRulePtr makeFromConfig(const char *config)
const string & getSourceFields() const
virtual bool shallCopyBefore() const =0
GB_ERROR get_error() const
static RulePtr makeAciConverter(const char *src, const char *sep, const char *aci, const char *dest)
GB_ERROR getError() const
ErrorOr< RulePtr > ErrorOrRulePtr
TransportedData readFrom(GBDATA *gb_item, GBDATA *gb_dest_item) const
__ATTR__USERESULT GB_ERROR writeTo(const TransportedData &data, GBDATA *gb_item, bool acceptLossyConversion) const
WriteRule(const char *name_, GB_TYPES forceType)
ItemClonedByRuleSet(GBDATA *&gb_item, ClonableItemType itemtype_, RuleSetPtr ruleset, ItemCloneType type_, GBDATA *gb_refItem, const AlignmentTransporter *aliTransporter)
__ATTR__USERESULT GB_ERROR transferBy(GBDATA *gb_source, GBDATA *gb_dest) const
void replace(int idx, RulePtr rule)
void saveWriteConfig(ConfigMapping &cfgmap) const
#define __ATTR__USERESULT
bool precisionLossPermitted() const
ReadRule(const string &fields_, const string &separator_)
static ErrorOrRuleSetPtr loadFrom(const char *filename)
void set_transferUndefFields(bool transferThem)
void extractUsedFields(StrArray &input, StrArray &output) const
ReadRule(const char *fields_, const char *separator_, const char *aci_)
SmartPtr< AlignmentTransporter > AlignmentTransporterPtr
virtual GB_ERROR transport(GBDATA *gb_src_item, GBDATA *gb_dst_item) const =0
ErrorOr< RuleSetPtr > ErrorOrRuleSetPtr
static TransportedData makeError(GB_ERROR error)
std::vector< RulePtr > RuleContainer
GB_write_int const char s