<commit_before>// ======================================================================== //
// Copyright 2009-2014 Intel Corporation                                    //
//                                                                          //
// Licensed under the Apache License, Version 2.0 (the "License");          //
// you may not use this file except in compliance with the License.         //
// You may obtain a copy of the License at                                  //
//                                                                          //
//     http://www.apache.org/licenses/LICENSE-2.0                           //
//                                                                          //
// Unless required by applicable law or agreed to in writing, software      //
// distributed under the License is distributed on an "AS IS" BASIS,        //
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //
// See the License for the specific language governing permissions and      //
// limitations under the License.                                           //
// ======================================================================== //

#pragma once

#include "ospray/common/OSPCommon.h"
#include <stack>

namespace ospray {
  namespace xml {

    /*! 'prop'erties in xml nodes are the 'name="value"' inside the
      <node name1="value1" name2="value2"> ... </node> description */
    struct Prop {
      std::string name;
      std::string value;
    };
    /*! a XML node, consisting of a name, a list of properties, and a
      set of child nodes */
    struct Node {
      std::string name;
      std::string content;
      std::vector<Prop *> prop;
      std::vector<Node *> child;
      // std::vector<Ref<Prop> > prop;
      // std::vector<Ref<Node> > child;
      
      inline std::string getProp(const std::string &name) const {
        for (int i=0;i<prop.size();i++) 
          if (prop[i]->name == name) return prop[i]->value; 
        return "";
      }
      Node() : name(""), content("") {}
      virtual ~Node();
    };<commit_msg>fixed missing function for qt model viewer<commit_after>// ======================================================================== //
// Copyright 2009-2014 Intel Corporation                                    //
//                                                                          //
// Licensed under the Apache License, Version 2.0 (the "License");          //
// you may not use this file except in compliance with the License.         //
// You may obtain a copy of the License at                                  //
//                                                                          //
//     http://www.apache.org/licenses/LICENSE-2.0                           //
//                                                                          //
// Unless required by applicable law or agreed to in writing, software      //
// distributed under the License is distributed on an "AS IS" BASIS,        //
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //
// See the License for the specific language governing permissions and      //
// limitations under the License.                                           //
// ======================================================================== //

#pragma once

#include "ospray/common/OSPCommon.h"
#include <stack>

namespace ospray {
  namespace xml {

    /*! 'prop'erties in xml nodes are the 'name="value"' inside the
      <node name1="value1" name2="value2"> ... </node> description */
    struct Prop {
      std::string name;
      std::string value;
    };
    /*! a XML node, consisting of a name, a list of properties, and a
      set of child nodes */
    struct Node {
      std::string name;
      std::string content;
      std::vector<Prop *> prop;
      std::vector<Node *> child;
      // std::vector<Ref<Prop> > prop;
      // std::vector<Ref<Node> > child;
      
      inline std::string getProp(const std::string &name) const {
        for (int i=0;i<prop.size();i++) 
          if (prop[i]->name == name) return prop[i]->value; 
        return "";
      }

      //*! find properly with given name, and return as long ('l')
      //*! int. return undefined if prop does not exist
      inline size_t getPropl(const std::string &name) const
      { return atol(getProp(name).c_str()); }
      
      Node() : name(""), content("") {}
      virtual ~Node();
    };
{'fraction_non_alphanumeric': 0.17556742323097463, 'fraction_numerical': 0.0075656430796617715, 'mean_word_length': 1.532394366197183, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 26, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7110245', 'n_tokens_mistral': 1053, 'n_tokens_neox': 1000, 'n_words': 360}