ICE 3.4.2
[php5-ice-freebsdport.git] / cpp / include / Slice / RubyUtil.h
blob8fabc031a374ff481112f282034bd654aa1a874b
1 // **********************************************************************
2 //
3 // Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
4 //
5 // This copy of Ice is licensed to you under the terms described in the
6 // ICE_LICENSE file included in this distribution.
7 //
8 // **********************************************************************
10 #ifndef SLICE_RUBY_UTIL_H
11 #define SLICE_RUBY_UTIL_H
13 #include <Slice/Parser.h>
14 #include <IceUtil/OutputUtil.h>
16 namespace Slice
18 namespace Ruby
22 // Generate Ruby code for a translation unit.
24 SLICE_API void generate(const Slice::UnitPtr&, bool, bool, const std::vector<std::string>&, IceUtilInternal::Output&);
27 // Check the given identifier against Ruby's list of reserved words. If it matches
28 // a reserved word, then an escaped version is returned with a leading underscore.
30 enum IdentStyle
32 IdentNormal,
33 IdentToUpper, // Mapped identifier must begin with an upper-case letter.
34 IdentToLower // Mapped identifier must begin with a lower-case letter.
36 SLICE_API std::string fixIdent(const std::string&, IdentStyle);
39 // Get the fully-qualified name of the given definition. If a prefix is provided,
40 // it is prepended to the definition's unqualified name.
42 SLICE_API std::string getAbsolute(const Slice::ContainedPtr&, IdentStyle, const std::string& = std::string());
45 // Emit a comment header.
47 SLICE_API void printHeader(IceUtilInternal::Output&);
52 #endif