You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
3.5 KiB

  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. /*
  18. * $Id: Xlat_Win32RC.hpp 470094 2006-11-01 20:41:30Z amassari $
  19. */
  20. class Win32RCFormatter : public XlatFormatter
  21. {
  22. public :
  23. // -----------------------------------------------------------------------
  24. // Public Constructors and Destructor
  25. // -----------------------------------------------------------------------
  26. Win32RCFormatter();
  27. virtual ~Win32RCFormatter();
  28. // -----------------------------------------------------------------------
  29. // Implementation of the formatter interface
  30. // -----------------------------------------------------------------------
  31. virtual void endDomain
  32. (
  33. const XMLCh* const domainName
  34. , const unsigned int msgCount
  35. );
  36. virtual void endMsgType
  37. (
  38. const MsgTypes type
  39. );
  40. virtual void endOutput();
  41. virtual void nextMessage
  42. (
  43. const XMLCh* const msgText
  44. , const XMLCh* const msgId
  45. , const unsigned int messageId
  46. , const unsigned int curId
  47. );
  48. virtual void startDomain
  49. (
  50. const XMLCh* const domainName
  51. , const XMLCh* const nameSpace
  52. );
  53. virtual void startMsgType
  54. (
  55. const MsgTypes type
  56. );
  57. virtual void startOutput
  58. (
  59. const XMLCh* const locale
  60. , const XMLCh* const outPath
  61. );
  62. private :
  63. // -----------------------------------------------------------------------
  64. // Unimplemented constructors and operators
  65. // -----------------------------------------------------------------------
  66. Win32RCFormatter(const Win32RCFormatter&);
  67. void operator=(const Win32RCFormatter&);
  68. // -----------------------------------------------------------------------
  69. // Private data members
  70. //
  71. // fCurDomainName
  72. // This is the short name for the current domain being processed.
  73. // This is used to create the names of information we write to the
  74. // file.
  75. //
  76. // fMsgOffset
  77. // Since we are going to put all the messages into a single message
  78. // table, we have to provide an offset for each domain (since they
  79. // each think that they have a unique numbering range.) So we just
  80. // offset each new domain by 0x2000 to keep them separate. When the
  81. // numbers are passed into the Win32RCMsgLoader, it will offset the
  82. // incoming message ids by the appropriate amount.
  83. //
  84. // fOutFl
  85. // This is the current output file. Its created when a new domain
  86. // is begun via startDomain() and closed when endDomain is called.
  87. // -----------------------------------------------------------------------
  88. XMLCh* fCurDomainName;
  89. unsigned int fMsgOffset;
  90. FILE* fOutFl;
  91. };