stlab.adobe.com Adobe Systems Incorporated
iomanip_asl_cel.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2005-2007 Adobe Systems Incorporated
3  Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
4  or a copy at http://stlab.adobe.com/licenses.html)
5 */
6 
7 /*************************************************************************************************/
8 
9 #ifdef ADOBE_STD_SERIALIZATION
10 
11 /*************************************************************************************************/
12 
13 #ifndef ADOBE_IOMANIP_ASL_CEL_HPP
14 #define ADOBE_IOMANIP_ASL_CEL_HPP
15 
16 /*************************************************************************************************/
17 
18 #include <adobe/config.hpp>
19 
20 #include <adobe/iomanip.hpp>
21 
22 /*************************************************************************************************/
23 
24 namespace adobe {
25 
26 /*************************************************************************************************/
27 
30 {
31  typedef format_base inherited_t;
32 
33 public:
35 
36  explicit asl_cel_format(bool safe_strings) :
37  escape_m(safe_strings)
38  { }
39 
40  virtual void begin_format(stream_type& os);
41 
42  virtual void begin_bag(stream_type& os, const std::string& ident);
43 
44  virtual void begin_sequence(stream_type& os);
45 
46  virtual void begin_atom(stream_type& os, const any_regular_t&);
47 
48 private:
49  virtual void stack_event(stream_type& os, bool is_push);
50 
51  void handle_atom(stream_type& os, bool is_push);
52 
53  bool escape_m;
54 };
55 
56 /*************************************************************************************************/
57 
59 inline std::ostream& begin_asl_cel(std::ostream& os)
60 {
61  replace_pword<format_base, asl_cel_format>(os, format_base_idx(), true);
62  return os << begin_format;
63 }
64 
65 /*************************************************************************************************/
66 
68 inline std::ostream& end_asl_cel(std::ostream& os)
69 { return os << end_format; }
70 
71 /*************************************************************************************************/
72 
74 inline std::ostream& begin_asl_cel_unsafe(std::ostream& os)
75 {
76  replace_pword<format_base, asl_cel_format>(os, format_base_idx(), false);
77  return os << begin_format;
78 }
79 
80 /*************************************************************************************************/
81 
83 inline std::ostream& end_asl_cel_unsafe(std::ostream& os)
84 { return os << end_format; }
85 
86 /*************************************************************************************************/
87 
88 } // namespace adobe
89 
90 /*************************************************************************************************/
91 
92 #endif
93 
94 /*************************************************************************************************/
95 
96 #endif
97 
98 /*************************************************************************************************/
std::ostream stream_type
Definition: iomanip.hpp:102
std::ostream & end_asl_cel_unsafe(std::ostream &os)
virtual void begin_format(stream_type &os)
inherited_t::stream_type stream_type
std::ostream & begin_asl_cel_unsafe(std::ostream &os)
virtual void begin_bag(stream_type &os, const std::string &ident)
int format_base_idx()
std::ostream & begin_asl_cel(std::ostream &os)
std::ostream & end_asl_cel(std::ostream &os)
virtual void begin_sequence(stream_type &os)
virtual void begin_atom(stream_type &os, const any_regular_t &)
asl_cel_format(bool safe_strings)
format_base::stream_type & begin_format(format_base::stream_type &os)
A runtime polymorphic type similar to boost::any which can hold any type which models Regular...
format_base::stream_type & end_format(format_base::stream_type &os)

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