<commit_before>/**
 * This file is part of the CernVM file system
 */

#include "sync_item.h"


#if !defined(__APPLE__)
#include <sys/sysmacros.h>
#endif  // __APPLE__

#include <cerrno>
#include <vector>

#include "duplex_libarchive.h"
#include "ingestion/ingestion_source.h"
#include "sync_mediator.h"
#include "sync_union.h"
#include "util/exception.h"

using namespace std;  // NOLINT

namespace publish {

SyncItem::SyncItem() :
  rdonly_type_(static_cast<SyncItemType>(0)),
  graft_size_(-1),
  scratch_type_(static_cast<SyncItemType>(0)),
  union_engine_(NULL),
  whiteout_(false),
  opaque_(false),
  masked_hardlink_(false),
  has_catalog_marker_(false),
  valid_graft_(false),
  graft_marker_present_(false),
  external_data_(false),
  graft_chunklist_(NULL),
  compression_algorithm_(zlib::kZlibDefault) {}

SyncItem::SyncItem(const std::string  &relative_parent_path,
                   const std::string  &filename,
                   const SyncUnion    *union_engine,
                   const SyncItemType entry_type) :
  rdonly_type_(kItemUnknown),
  graft_size_(-1),
  scratch_type_(entry_type),
  filename_(filename),
  union_engine_(union_engine),
  whiteout_(false),
  opaque_(false),
  masked_hardlink_(false),
  has_catalog_marker_(false),
  valid_graft_(false),
  graft_marker_present_(false),
  external_data_(false),
  relative_parent_path_(relative_parent_path),
  graft_chunklist_(NULL),
  compression_algorithm_(zlib::kZlibDefault) {
  content_hash_.algorithm = shash::kAny;
}

SyncItem::~SyncItem() {
  delete graft_chunklist_;
}


SyncItemType SyncItem::GetGenericFiletype(const SyncItem::EntryStat &stat) const
{
  const SyncItemType type = stat.GetSyncItemType();
  if (type == kItemUnknown) {
   PANIC(kLogStderr,
          "[WARNING] '%s' has an unsupported file type (st_mode: %d errno: %d)",
          GetRelativePath().c_str(), stat.stat.st_mode, stat.error_code);<commit_msg>[LINT] identation fix<commit_after>/**
 * This file is part of the CernVM file system
 */

#include "sync_item.h"


#if !defined(__APPLE__)
#include <sys/sysmacros.h>
#endif  // __APPLE__

#include <cerrno>
#include <vector>

#include "duplex_libarchive.h"
#include "ingestion/ingestion_source.h"
#include "sync_mediator.h"
#include "sync_union.h"
#include "util/exception.h"

using namespace std;  // NOLINT

namespace publish {

SyncItem::SyncItem() :
  rdonly_type_(static_cast<SyncItemType>(0)),
  graft_size_(-1),
  scratch_type_(static_cast<SyncItemType>(0)),
  union_engine_(NULL),
  whiteout_(false),
  opaque_(false),
  masked_hardlink_(false),
  has_catalog_marker_(false),
  valid_graft_(false),
  graft_marker_present_(false),
  external_data_(false),
  graft_chunklist_(NULL),
  compression_algorithm_(zlib::kZlibDefault) {}

SyncItem::SyncItem(const std::string  &relative_parent_path,
                   const std::string  &filename,
                   const SyncUnion    *union_engine,
                   const SyncItemType entry_type) :
  rdonly_type_(kItemUnknown),
  graft_size_(-1),
  scratch_type_(entry_type),
  filename_(filename),
  union_engine_(union_engine),
  whiteout_(false),
  opaque_(false),
  masked_hardlink_(false),
  has_catalog_marker_(false),
  valid_graft_(false),
  graft_marker_present_(false),
  external_data_(false),
  relative_parent_path_(relative_parent_path),
  graft_chunklist_(NULL),
  compression_algorithm_(zlib::kZlibDefault) {
  content_hash_.algorithm = shash::kAny;
}

SyncItem::~SyncItem() {
  delete graft_chunklist_;
}


SyncItemType SyncItem::GetGenericFiletype(const SyncItem::EntryStat &stat) const
{
  const SyncItemType type = stat.GetSyncItemType();
  if (type == kItemUnknown) {
    PANIC(kLogStderr,
          "[WARNING] '%s' has an unsupported file type (st_mode: %d errno: %d)",
          GetRelativePath().c_str(), stat.stat.st_mode, stat.error_code);
{'fraction_non_alphanumeric': 0.12366292721106183, 'fraction_numerical': 0.0020871380120010435, 'mean_word_length': 5.028301886792453, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '4074438', 'n_tokens_mistral': 1335, 'n_tokens_neox': 1319, 'n_words': 223}