var builder = new StringBuilder ("\"");
char* p = _name;
- char* end = p + _name.size ();
+ char* end = p + _name.length;
// remove quotes
p++;
if (p_expr is StringLiteral) {
var s_exp = (StringLiteral) p_expr;
- var len = s_exp.value.size ();
+ var len = s_exp.value.length;
if (len > 2) {
string s = "\\n\"";
common_prefix = cname;
while (common_prefix.length > 0 && !common_prefix.has_suffix ("_")) {
// FIXME: could easily be made faster
- common_prefix = common_prefix.ndup (common_prefix.size () - 1);
+ common_prefix = common_prefix.ndup (common_prefix.length - 1);
}
} else {
while (!cname.has_prefix (common_prefix)) {
- common_prefix = common_prefix.ndup (common_prefix.size () - 1);
+ common_prefix = common_prefix.ndup (common_prefix.length - 1);
}
}
while (common_prefix.length > 0 && (!common_prefix.has_suffix ("_") ||
(cname.offset (common_prefix.length).get_char ().isdigit ()) && (cname.length - common_prefix.length) <= 1)) {
// enum values may not consist solely of digits
- common_prefix = common_prefix.ndup (common_prefix.size () - 1);
+ common_prefix = common_prefix.ndup (common_prefix.length - 1);
}
}
int l = 0;
while (value.has_suffix ("l") || value.has_suffix ("L")) {
l++;
- value = value.ndup (value.size () - 1);
+ value = value.ndup (value.length - 1);
}
bool u = false;
if (value.has_suffix ("u") || value.has_suffix ("U")) {
u = true;
- value = value.ndup (value.size () - 1);
+ value = value.ndup (value.length - 1);
}
int64 n = value.to_int64 ();
}
}
+ [Deprecated (replacement = "string.length")]
[CCode (cname = "strlen")]
public size_t size ();
if (str == null) {
str_size = 0;
} else {
- str_size = str.size ();
+ str_size = str.length;
}
- string* result = GLib.malloc0 (this.size () - ((char*) end_string - (char*) start_string) + str_size + 1);
+ string* result = GLib.malloc0 (this.length - ((char*) end_string - (char*) start_string) + str_size + 1);
char* dest = (char*) result;
GLib.Memory.copy (dest, str, str_size);
dest += str_size;
- GLib.Memory.copy (dest, end_string, end_string.size ());
+ GLib.Memory.copy (dest, end_string, end_string.length);
return (owned) result;
}
public uint8[] data {
get {
unowned uint8[] res = (uint8[]) this;
- res.length = (int) this.size ();
+ res.length = (int) this.length;
return res;
}
}
public char[] to_utf8 () {
- char[] result = new char[this.size () + 1];
+ char[] result = new char[this.length + 1];
result.length--;
- GLib.Memory.copy (result, this, this.size ());
+ GLib.Memory.copy (result, this, this.length);
return result;
}
}
private void parse_file (SourceFile source_file) {
- string metadata_filename = "%s.metadata".printf (source_file.filename.ndup (source_file.filename.size () - ".gi".size ()));
+ string metadata_filename = "%s.metadata".printf (source_file.filename.ndup (source_file.filename.length - ".gi".length));
current_source_file = source_file;
common_prefix = value.name;
while (common_prefix.length > 0 && !common_prefix.has_suffix ("_")) {
// FIXME: could easily be made faster
- common_prefix = common_prefix.ndup (common_prefix.size () - 1);
+ common_prefix = common_prefix.ndup (common_prefix.length - 1);
}
} else {
while (!value.name.has_prefix (common_prefix)) {
- common_prefix = common_prefix.ndup (common_prefix.size () - 1);
+ common_prefix = common_prefix.ndup (common_prefix.length - 1);
}
}
while (common_prefix.length > 0 && (!common_prefix.has_suffix ("_") ||
(value.name.offset (common_prefix.length).get_char ().isdigit ()) && (value.name.length - common_prefix.length) <= 1)) {
// enum values may not consist solely of digits
- common_prefix = common_prefix.ndup (common_prefix.size () - 1);
+ common_prefix = common_prefix.ndup (common_prefix.length - 1);
}
}
}
GLib.SList<string> attr_list = new GLib.SList<string> ();
- var attr = new GLib.StringBuilder.sized (attributes.size ());
+ var attr = new GLib.StringBuilder.sized (attributes.length);
var attributes_len = attributes.length;
unowned string remaining = attributes;
bool quoted = false, escaped = false;
}
private string eval (string s) {
- return ((s.size () >= 2) && s.has_prefix ("\"") && s.has_suffix ("\"")) ? s.offset (1).ndup (s.size () - 2) : s;
+ return ((s.length >= 2) && s.has_prefix ("\"") && s.has_suffix ("\"")) ? s.offset (1).ndup (s.length - 2) : s;
}
private Signal? parse_signal (IdlNodeSignal sig_node) {
var tokens = line.split (" ", 2);
var symbol = tokens[0];
- if (symbol.size () > 0 && !_symbols.contains (symbol)) {
+ if (symbol.length > 0 && !_symbols.contains (symbol)) {
var src = new SourceReference (metadata, lineno, 1, lineno, (int)symbol.length);
Report.error (src, "Symbol `%s' not found".printf (symbol));
}