HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VOP_LanguageInfo.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: VOP_LanguageInfo.h ( Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __VOP_LanguageInfo__
12 #define __VOP_LanguageInfo__
13 
14 #include "VOP_API.h"
15 #include "VOP_Types.h"
16 #include <UT/UT_StringHolder.h>
17 
18 
19 // ============================================================================
20 /// Class for referencing languages in VOPs.
21 /// It can be used to obtain the registered VOP_Language definition object.
23 {
24 public:
25  /// @{
26  /// A constructor and a destructor.
27  // NB: explicit keyword is useful during sweeps to convert code from
28  // VOP_LanguageType to VOP_Languagenfo.
30  const UT_StringRef &lang_name = UT_StringRef() )
31  : myType(type), myName(lang_name)
32  {
33  }
34  /// @}
35 
36  /// Returns the type enumeration value of the language.
38  { return myType; }
39 
40  /// Returns the language name this info refers to.
41  const UT_StringHolder & getName() const
42  { return myName; }
43 
44 private:
45  /// The basic type of a language.
46  VOP_LanguageType myType;
47 
48  /// The name of the language, for custom languages.
49  /// For hard-coded languages it is an empty string
50  /// (though it could contain the official name too).
51  UT_StringHolder myName;
52 };
53 
54 #endif
55 
const UT_StringHolder & getName() const
Returns the language name this info refers to.
VOP_LanguageType getType() const
Returns the type enumeration value of the language.
VOP_LanguageInfo(VOP_LanguageType type=VOP_LANGUAGE_INVALID, const UT_StringRef &lang_name=UT_StringRef())
type
Definition: core.h:1059
VOP_LanguageType
Definition: VOP_Types.h:186