[odb-users] Accesor/modifier/column built-in regex

Boris Kolpackov boris at codesynthesis.com
Mon Jan 11 09:28:57 EST 2016


Hi Aarón,

Aarón Bueno Villares <abv150ci at gmail.com> writes:

> I would like to know what is the built-in regexes for accesors and
> modifiers searching, because the documentation don't give specific details
> about that.

We don't list them because they are quite hairy and may change in the future.
But you can always check the source code (odb/context.cxx):

  data_->accessor_regex_.push_back (regexsub ("/(.+)/get_$1/"));   // get_foo
  data_->accessor_regex_.push_back (regexsub ("/(.+)/get\\u$1/")); // getFoo
  data_->accessor_regex_.push_back (regexsub ("/(.+)/get$1/"));    // getfoo
  data_->accessor_regex_.push_back (regexsub ("/(.+)/$1/"));       // foo

  data_->modifier_regex_.push_back (regexsub ("/(.+)/set_$1/"));   // set_foo
  data_->modifier_regex_.push_back (regexsub ("/(.+)/set\\u$1/")); // setFoo
  data_->modifier_regex_.push_back (regexsub ("/(.+)/set$1/"));    // setfoo
  data_->modifier_regex_.push_back (regexsub ("/(.+)/$1/"));       // foo

Also, you can always see what gets tried and what matched and in which
order with --accessor-regex-trace.

Boris



More information about the odb-users mailing list