View | Details | Raw Unified | Return to bug 2991
Collapse All | Expand All

(-)a/object-factory.cc (-2 / +25 lines)
 Lines 120-132    Link Here 
120
  os << "]";
120
  os << "]";
121
  return os;
121
  return os;
122
}
122
}
123
124
std::string::size_type
125
findNextAtt (std::string &str, size_t pos)
126
{
127
  int level = 0;
128
  for (std::string::size_type i = pos; i < str.size (); i++)
129
    {
130
      if (level == 0 && str[i] == '|')
131
        {
132
          return i;
133
        }
134
      if (str[i] == '[')
135
        {
136
          level++;
137
        }
138
      else if (str[i] == ']')
139
        {
140
          level--;
141
        }
142
    }
143
  return std::string::npos;
144
}
145
123
std::istream & operator >> (std::istream &is, ObjectFactory &factory)
146
std::istream & operator >> (std::istream &is, ObjectFactory &factory)
124
{
147
{
125
  std::string v;
148
  std::string v;
126
  is >> v;
149
  is >> v;
127
  std::string::size_type lbracket, rbracket;
150
  std::string::size_type lbracket, rbracket;
128
  lbracket = v.find ("[");
151
  lbracket = v.find ("[");
129
  rbracket = v.find ("]");
152
  rbracket = v.rfind ("]");
130
  if (lbracket == std::string::npos && rbracket == std::string::npos)
153
  if (lbracket == std::string::npos && rbracket == std::string::npos)
131
    {
154
    {
132
      factory.SetTypeId (v);
155
      factory.SetTypeId (v);
 Lines 162-168    Link Here 
162
            }
185
            }
163
          else
186
          else
164
            {
187
            {
165
              std::string::size_type next = parameters.find ("|", cur);
188
              std::string::size_type next = findNextAtt (parameters, cur);
166
              std::string value;
189
              std::string value;
167
              if (next == std::string::npos)
190
              if (next == std::string::npos)
168
                {
191
                {

Return to bug 2991