<commit_before>// GtkSharp.Generation.FieldBase.cs - base class for struct and object
// fields
//
// Copyright (c) 2004 Novell, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public
// License along with this program; if not, write to the
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.


namespace GtkSharp.Generation {

	using System;
	using System.Collections;
	using System.IO;
	using System.Xml;

	public abstract class FieldBase : PropertyBase {
		public FieldBase (XmlElement elem, ClassBase container_type) : base (elem, container_type) {}

		public virtual bool Validate (LogWriter log)
		{
			log.Member = Name;
			if (!Ignored && !Hidden && CSType == "") {
				log.Warn ("field has unknown type: " + CType);
				Statistics.ThrottledCount++;
				return false;
			}

			return true;
		}

		internal virtual bool Readable {
			get {
				if (Parser.GetVersion (elem.OwnerDocument.DocumentElement) <= 2)
					return elem.GetAttribute ("readable") != "false";
				return elem.HasAttribute ("readable") && elem.GetAttributeAsBoolean ("readable");
			}
		}

		internal virtual bool Writable {
			get {
				if (Parser.GetVersion (elem.OwnerDocument.DocumentElement) <= 2)
					return elem.GetAttribute ("writeable") != "false";
				return elem.HasAttribute ("writeable") && elem.GetAttributeAsBoolean ("writeable");
			}
		}

		protected abstract string DefaultAccess { get; }

		internal string Access {
			get {
				return elem.HasAttribute ("access") ? elem.GetAttribute ("access") : DefaultAccess;
			}<commit_msg>generator: ignore private structs completely<commit_after>// GtkSharp.Generation.FieldBase.cs - base class for struct and object
// fields
//
// Copyright (c) 2004 Novell, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public
// License along with this program; if not, write to the
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.


namespace GtkSharp.Generation {

	using System;
	using System.Collections;
	using System.IO;
	using System.Xml;

	public abstract class FieldBase : PropertyBase {
		public FieldBase (XmlElement elem, ClassBase container_type) : base (elem, container_type) {}

		public virtual bool Validate (LogWriter log)
		{
			log.Member = Name;
			if (!Ignored && !Hidden && CSType == "") {
				if (Name == "Priv")
					return false;
				log.Warn ("field has unknown type: " + CType);
				Statistics.ThrottledCount++;
				return false;
			}

			return true;
		}

		internal virtual bool Readable {
			get {
				if (Parser.GetVersion (elem.OwnerDocument.DocumentElement) <= 2)
					return elem.GetAttribute ("readable") != "false";
				return elem.HasAttribute ("readable") && elem.GetAttributeAsBoolean ("readable");
			}
		}

		internal virtual bool Writable {
			get {
				if (Parser.GetVersion (elem.OwnerDocument.DocumentElement) <= 2)
					return elem.GetAttribute ("writeable") != "false";
				return elem.HasAttribute ("writeable") && elem.GetAttributeAsBoolean ("writeable");
			}
		}

		protected abstract string DefaultAccess { get; }

		internal string Access {
			get {
				return elem.HasAttribute ("access") ? elem.GetAttribute ("access") : DefaultAccess;
			}
{'fraction_non_alphanumeric': 0.10426770126091174, 'fraction_numerical': 0.010184287099903006, 'mean_word_length': 3.5032751091703056, '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': '3673017', 'n_tokens_mistral': 1296, 'n_tokens_neox': 1105, 'n_words': 439}