1 // **********************************************************************
3 // Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
5 // This copy of Ice is licensed to you under the terms described in the
6 // ICE_LICENSE file included in this distribution.
8 // **********************************************************************
10 #ifndef SLICE_PHP_UTIL_H
11 #define SLICE_PHP_UTIL_H
13 #include <Slice/Parser.h>
21 // Convert a scoped name into a PHP name.
23 SLICE_API
std::string
scopedToName(const std::string
&, bool);
26 // Check the given identifier against PHP's list of reserved words. If it matches
27 // a reserved word, then an escaped version is returned with a leading underscore.
29 SLICE_API
std::string
fixIdent(const std::string
&);
32 // Get the fully-qualified name of the given definition. If a suffix is provided,
33 // it is prepended to the definition's unqualified name. If the nameSuffix
34 // is provided, it is appended to the container's name.
36 // COMPILERFIX: MSVC 6 seems to have a problem with const std::string
37 // = std::string(), const std::string = std::string().
39 SLICE_API
std::string
getAbsolute(const Slice::ContainedPtr
&, bool, const std::string
& = "", const std::string
& = "");
42 // Since PHP uses the backslash character as the namespace separator, we have
43 // to escape backslash characters when they appear in a string literal.
45 SLICE_API
std::string
escapeName(const std::string
&);