hce-node application  1.4.3
HCE Hierarchical Cluster Engine node application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TagReducePlugin.cpp
Go to the documentation of this file.
1 
6 #include "TagReducePlugin.hpp"
7 
8 
9 namespace HCE
10 {
11 
12 namespace component
13 {
14 
15 
17 {
21  ProcessInfo processInfo;
23  _exported.push_back( processInfo );
24 
28  unsigned short buf[TAG_CODES_TOTAL_NUMBER+1];
29  for ( unsigned short i=0; i<TAG_CODES_TOTAL_NUMBER; ++i )
30  {
31  buf[i] = TAG_CODES_BASE+i;
32  }
33  UnicodeString ustr( reinterpret_cast<CHAR_TYPE*>(buf), TAG_CODES_TOTAL_NUMBER<<1, "UCS2" );
34  ustr.toUTF8String(_tags);
35 }
36 
37 
39 {
40 }
41 
42 
44 {
48  UnicodeString ustr( lCData._content.c_str() );
53  for ( int i=0; i<ustr.length(); ++i )
54  {
58  if ( isTagCode(ustr[i]) )
59  {
63  lCData._mapTags[i] = ustr[i];
67  ustr.replace(i, 1, UChar(' '));
68  }
69  }
73  const_cast<std::string&>(lCData._content).erase();
74  ustr.toUTF8String( const_cast<std::string&>(lCData._content) );
75 #ifdef _DEBUG_
76  std::cout << std::endl << "TagReducePlugin plugin" << std::endl << std::endl;
77 #endif
78 }
79 
80 
81 } /* namespace component */
82 
83 } /* namespace HCE */
84