stlab.adobe.com Adobe Systems Incorporated

xstring_context_t Class Reference
[xstring Glossary System]

Scope-based runtime context stack for glossary lookups. More...

#include <adobe/xstring.hpp>

List of all members.

Public Types

typedef
implementation::context_frame_t::callback_proc_t 
callback_proc_t
typedef
implementation::context_frame_t::preorder_predicate_t 
preorder_predicate_t

Public Member Functions

void set_element_handler (callback_proc_t proc)
void set_preorder_predicate (preorder_predicate_t proc)
 xstring_context_t (const char *parse_first, const char *parse_last, const line_position_t &parse_info=line_position_t("xstring_context_t"))
template<typename I >
 xstring_context_t (I first_attribute, I last_attribute)
template<typename I >
 xstring_context_t (I first_attribute, I last_attribute, const unsigned char *parse_first, const unsigned char *parse_last, const line_position_t &parse_info=line_position_t("xstring_context_t"))
 ~xstring_context_t ()

Detailed Description

The xstring_context_t class is used to add context sensitivity to xstring lookups. Example:

{
    adobe::attribute_set_t attribute_set;

    attribute_set.push_back(std::make_pair(adobe::static_name_t("context"), adobe::static_name_t("some_view")));

    adobe::xstring_context_t mycontext(attribute_set);

    // anything here is looked up with the context='some_view'; other attributes remain unchanged
}
// now our context is out scope and we go back to what we had before.

There is also a constructor that takes a name/value pair for simple context construction. Example:

{
    adobe::xstring_context_t mycontext(adobe::static_name_t("context"), adobe::static_name_t("some_view"));

    // anything here is looked up with the context='some_view'; other attributes remain unchanged
}
// now our context is out scope and we go back to what we had before.

There is also a constructor that takes a set of std::pair<adobe::name_t, adobe::name_t> for simple context construction. Example:

{
    std::vector<std::pair<adobe::name_t, adobe::name_t> > my_set;

    // fill in my_set ...

    adobe::xstring_context_t mycontext(&my_set[0], &my_set[my_set.size()]);

    // anything here is looked up with a context affected by my_set
}
// now our context is out scope and we go back to what we had before.

Definition at line 275 of file xstring.hpp.


Member Typedef Documentation

typedef implementation::context_frame_t::callback_proc_t callback_proc_t

Definition at line 277 of file xstring.hpp.

typedef implementation::context_frame_t::preorder_predicate_t preorder_predicate_t

Definition at line 278 of file xstring.hpp.


Constructor & Destructor Documentation

xstring_context_t ( const char *  parse_first,
const char *  parse_last,
const line_position_t parse_info = line_position_t("xstring_context_t") 
)

Definition at line 280 of file xstring.hpp.

xstring_context_t ( first_attribute,
last_attribute 
)

Definition at line 297 of file xstring.hpp.

xstring_context_t ( first_attribute,
last_attribute,
const unsigned char *  parse_first,
const unsigned char *  parse_last,
const line_position_t parse_info = line_position_t("xstring_context_t") 
)

Definition at line 305 of file xstring.hpp.

Definition at line 330 of file xstring.hpp.


Member Function Documentation

void set_element_handler ( callback_proc_t  proc )

Definition at line 327 of file xstring.hpp.

void set_preorder_predicate ( preorder_predicate_t  proc )

Definition at line 324 of file xstring.hpp.

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google