api/pointer.vala \
api/property.vala \
api/propertyaccessor.vala \
- api/propertyaccessortype.vala \
api/signal.vala \
api/signaturebuilder.vala \
api/sourcefile.vala \
* Represents a get or set accessor of a property.
*/
public class Valadoc.Api.PropertyAccessor : Symbol {
- private PropertyAccessorType type;
private Ownership ownership;
private string? cname;
public PropertyAccessor (Property parent, SourceFile file, string name, Vala.SymbolAccessibility accessibility,
- string? cname, PropertyAccessorType type, Ownership ownership, Vala.PropertyAccessor data)
+ string? cname, Ownership ownership, Vala.PropertyAccessor data)
{
base (parent, file, name, accessibility, null, data);
this.ownership = ownership;
this.cname = cname;
- this.type = type;
}
/**
*/
public bool is_construct {
get {
- return (type & PropertyAccessorType.CONSTRUCT) != 0;
+ return ((Vala.PropertyAccessor) data).construction;
}
}
*/
public bool is_set {
get {
- return (type & PropertyAccessorType.SET) != 0;
+ return ((Vala.PropertyAccessor) data).writable;
}
}
*/
public bool is_get {
get {
- return (type & PropertyAccessorType.GET) != 0;
+ return ((Vala.PropertyAccessor) data).readable;
}
}
+++ /dev/null
-/* propertyaccessor.vala
- *
- * Copyright (C) 2011 Florian Brosch
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Author:
- * Florian Brosch <flo.brosch@gmail.com>
- */
-
-
-public enum Valadoc.Api.PropertyAccessorType {
- CONSTRUCT = 1 << 0,
- SET = 1 << 1,
- GET = 1 << 2;
-
- public unowned string to_string () {
- if ((this & PropertyAccessorType.CONSTRUCT) != 0) {
- if ((this & PropertyAccessorType.SET) != 0) {
- return "construct set";
- }
- return "construct";
- } else if ((this & PropertyAccessorType.SET) != 0) {
- return "set";
- } else if ((this & PropertyAccessorType.GET) != 0) {
- return "get";
- }
-
- assert_not_reached ();
- }
-}
return meta_data.get_namespace ((Vala.Namespace) namespace_symbol, file);
}
- private PropertyAccessorType get_property_accessor_type (Vala.PropertyAccessor element) {
- if (element.construction) {
- if (element.writable) {
- return (PropertyAccessorType.CONSTRUCT | PropertyAccessorType.SET);
- }
- return PropertyAccessorType.CONSTRUCT;
- } else if (element.writable) {
- return PropertyAccessorType.SET;
- } else if (element.readable) {
- return PropertyAccessorType.GET;
- }
-
- error ("Unknown symbol accessibility type");
- }
-
private bool type_reference_pass_ownership (Vala.DataType? element) {
if (element == null) {
return false;
element.name,
accessor.access,
get_cname (accessor),
- get_property_accessor_type (accessor),
get_property_ownership (accessor),
accessor);
}
element.name,
accessor.access,
get_cname (accessor),
- get_property_accessor_type (accessor),
get_property_ownership (accessor),
accessor);
}