<commit_before>#ifndef APPLICATIONFILTER_HPP
#define APPLICATIONFILTER_HPP

#include "bridge.h"
#include "CommonData.hpp"
#include "IOLogWrapper.hpp"
#include "RemapFilterBase.hpp"

namespace org_pqrs_Karabiner {
  namespace RemapFilter {
    class ApplicationFilter : public RemapFilterBase {
    public:
      ApplicationFilter(unsigned int type) : RemapFilterBase(type) {}

      void initialize(const unsigned int* vec, size_t length) {
        for (size_t i = 0; i < length; ++i) {
          targets_.push_back(AddValue(vec[i]));
        }
      }

      bool isblocked(void) {
        unsigned int current = CommonData::getcurrent_workspacedata().applicationtype;

        if (get_type() == BRIDGE_FILTERTYPE_APPLICATION_NOT ||
            get_type() == BRIDGE_FILTERTYPE_APPLICATION_ONLY) {

          bool isnot = (get_type() == BRIDGE_FILTERTYPE_APPLICATION_NOT);

          for (size_t i = 0; i < targets_.size(); ++i) {
            if (targets_[i] == current) {
              return isnot ? true : false;
            }
          }

          return isnot ? false : true;

        } else {
          IOLOG_ERROR("ApplicationFilter::isblocked unknown type_(%d)\n", get_type());
          return false;
        }
      }

    private:
      Vector_AddValue targets_;
    };
  }
}

#endif
<commit_msg>minor change<commit_after>#ifndef APPLICATIONFILTER_HPP
#define APPLICATIONFILTER_HPP

#include "bridge.h"
#include "CommonData.hpp"
#include "IOLogWrapper.hpp"
#include "RemapFilterBase.hpp"

namespace org_pqrs_Karabiner {
  namespace RemapFilter {
    class ApplicationFilter : public RemapFilterBase {
    public:
      ApplicationFilter(unsigned int type) : RemapFilterBase(type) {}

      void initialize(const unsigned int* vec, size_t length) {
        for (size_t i = 0; i < length; ++i) {
          targets_.push_back(AddValue(vec[i]));
        }
      }

      bool isblocked(void) {
        unsigned int current = CommonData::getcurrent_workspacedata().applicationtype;

        if (get_type() == BRIDGE_FILTERTYPE_APPLICATION_NOT ||
            get_type() == BRIDGE_FILTERTYPE_APPLICATION_ONLY) {

          bool isnot = (get_type() == BRIDGE_FILTERTYPE_APPLICATION_NOT);

          for (size_t i = 0; i < targets_.size(); ++i) {
            if (targets_[i] == current) {
              return isnot ? true : false;
            }
          }

          return isnot ? false : true;
        }

        IOLOG_ERROR("ApplicationFilter::isblocked unknown type(%d)\n", get_type());
        return false;
      }

    private:
      Vector_AddValue targets_;
    };
  }
}

#endif

{'fraction_non_alphanumeric': 0.10798303123794832, 'fraction_numerical': 0.0015426147319706903, 'mean_word_length': 2.617852161785216, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5004412', 'n_tokens_mistral': 821, 'n_tokens_neox': 779, 'n_words': 168}