Ejemplo n.º 1
0
 void found_object(boost::iterator_range<Iterator> m) {
     std::string s(m.begin(), m.end());
     cout << "Found object name :" << s <<endl;
     method.is_object=true;
     iface_objects.push_back( s );
     method.name = s;
     cout << method << endl;
 }
Ejemplo n.º 2
0
    ancestor_iterator(boost::iterator_range<ParentIterator> r)
        :parent_it(r.begin()), parent_end(r.end()), depth(0) {
        if (parent_it != parent_end) {
            c.reset(new typename super::value_type(*parent_it));
            find_next_parent();
        }

    };
Ejemplo n.º 3
0
        explicit variable(boost::iterator_range<Iterator> const& token) :
            _position(token.begin().position())
        {
            // Remove the $ from the name
            auto it = token.begin();
            ++it;
            _name.assign(it, token.end());

            validate_name();
        }
 inline bool string_generate(OutputIterator& sink
   , boost::iterator_range<Iterator> const& r)
 {
     Iterator end = r.end();
     for (Iterator it = r.begin(); it != end; ++it)
     {
         *sink = *it;
         ++sink;
     }
     return detail::sink_is_good(sink);
 }
Ejemplo n.º 5
0
 attribute_iterator(boost::iterator_range<ParentIterator> r)
     :parent_it(r.begin()), parent_end(r.end()) {
     if (parent_it != parent_end) {
         auto attributes = (*parent_it).attributes();
         attribute_it = attributes.begin();
         attribute_end = attributes.end();
         if (attribute_it == attribute_end) {
             go_to_next();
         }
     }
 }
 inline bool string_generate(OutputIterator& sink
   , boost::iterator_range<Iterator> const& r, CharEncoding, Tag)
 {
     Iterator end = r.end();
     for (Iterator it = r.begin(); it != end; ++it)
     {
         *sink = spirit::char_class::convert<CharEncoding>::to(Tag(), *it);
         ++sink;
     }
     return detail::sink_is_good(sink);
 }
Ejemplo n.º 7
0
    descendant_iterator(boost::iterator_range<ParentIterator> r)
        :parent_it(r.begin()), parent_end(r.end()), depth(0) {
        if (parent_it != parent_end) {
            c.reset(new typename super::value_type(*parent_it));
            if (c->has_children()) {
                c->first_child();
                depth++;
            } else {
                find_next_leaf();
            }
        }

    };
Ejemplo n.º 8
0
        explicit regex(boost::iterator_range<Iterator> const& token) :
            _position(token.begin().position())
        {
            auto start = token.begin();
            auto end = token.end();

            if (start != end) {
                ++start;
            }

            // Move the end to the position before the closing / character
            auto last = start;
            for (auto current = start; current != end; ++current) {
                last = current;
            }
            _value.assign(start, last);
        }
Ejemplo n.º 9
0
			static boost::tuple< boost::iterator_range<InputIterator>, size_t >
			apply(unsigned long& v, boost::iterator_range<InputIterator> const& input){
				
				auto iter = input.begin();
				auto const& end = input.end();

				unsigned char * raw_int = reinterpret_cast<unsigned char*>(&v);
				unsigned char const * const raw_int_end = raw_int+sizeof(v);

				while(raw_int!=raw_int_end){

					if( iter==end ) STCRYPT_THROW_EXCEPTION( sio::exception::underflow() );

					*raw_int = *iter;
					++iter;
					++raw_int;
				}

				return boost::make_tuple( boost::make_iterator_range(iter, end), sizeof(unsigned long) );

			}
Ejemplo n.º 10
0
			static boost::tuple< boost::iterator_range<InputIterator>, size_t >
			apply(unsigned char (&v)[N], boost::iterator_range<InputIterator> const& input){

					auto iter = input.begin();
					auto const& end = input.end();

					unsigned char * out_cur = reinterpret_cast<unsigned char*>(&v);
					unsigned char const * const out_end = out_cur+sizeof(v);

					while(out_cur !=out_end){

						if( iter==end ) STCRYPT_THROW_EXCEPTION( sio::exception::underflow() );

						*out_cur = *iter;
						++iter;
						++out_cur;
					}

					return boost::make_tuple( boost::make_iterator_range(iter, end), sizeof(v) );

			}
Ejemplo n.º 11
0
    void found_caller(boost::iterator_range<Iterator> m) {
        std::string s(m.begin(), m.end());
//        cout << "Found C++ caller :" << s <<endl;
        method.caller = s;
    }
Ejemplo n.º 12
0
Parser::Parser(boost::iterator_range<ByteBuffer::const_iterator> range) :
    Parser(range.begin(), range.end())
{
}
Ejemplo n.º 13
0
 explicit type(boost::iterator_range<Iterator> const& token) :
     _position(token.begin().position()),
     _name(token.begin(), token.end())
 {
 }
Ejemplo n.º 14
0
    void found_arg_desc(boost::iterator_range<Iterator> m) {
        std::string s(m.begin(), m.end());
//        cout << "Found arg desc :" << s <<endl;
        bf::get<1>(method.args.back()) = s;
    }
Ejemplo n.º 15
0
    void found_arg(boost::iterator_range<Iterator> m) {
        std::string s(m.begin(), m.end());
//        cout << "Found arg :" << s <<endl;
        method.args.push_back( arg_desc_type(s,"") );
    }
Ejemplo n.º 16
0
    void found_desc(boost::iterator_range<Iterator> m) {
        std::string s(m.begin(), m.end());
//        cout << "Found description :" << s <<endl;
        method.description = s;
    }
Ejemplo n.º 17
0
    boost::to_upper(a);
    std::cout << a << std::endl;
    std::string b = boost::to_lower_copy(a);
    std::cout << a << " " << b << std::endl;

    std::cout << "---------erase---------" << std::endl;
    a = "wangbing hehe   wangbing   ";
    boost::erase_first(a, "hehe");
    std::cout << a << std::endl;

    std::cout << "---------find---------" << std::endl;
    a = "wangbing hehe   wangbing   b1234_";
    boost::regex rx("b[0-9]+_");
    b = "hehe";
    boost::iterator_range< std::string::iterator> it = boost::find_first(a, b);
    std::cout << (it.end() - it.begin()) << " " << std::string(it.begin(), it.end()) << std::endl;
    it = boost::find_regex(a, rx);
    std::cout << (it.end() - it.begin()) << " " << std::string(it.begin(), it.end()) << std::endl;
    
    std::cout << "---------predicate---------" << std::endl;
    a = "wangbing hehe   wangbing   b1234_";
    if(boost::starts_with(a, "wangbing")) {
        std::cout << "hehe" << std::endl;
    }

    std::cout << "---------replace---------" << std::endl;
    a = "wangbing hehe   wangbing   b1234_";
    std::string re = boost::replace_first_copy(a, "wangbing", "WANGBING");
    std::cout << re << std::endl << a << std::endl;

    std::cout << "---------trim---------" << std::endl;
Ejemplo n.º 18
0
    void found_completion(boost::iterator_range<Iterator> m) {
        std::string s(m.begin(), m.end());
//        cout << "Found C/C++ function :" << s <<endl;
        method.completion = s;
    }