~ubuntu-branches/ubuntu/saucy/geary/saucy-updates

« back to all changes in this revision

Viewing changes to src/engine/util/util-string.vala

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2013-03-14 13:48:23 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20130314134823-gyk5av1g508zyj8a
Tags: 0.3.0~pr1-0ubuntu1
New upstream version (FFE lp: #1154316), supports multiple account as
well as full conversation views with inline replies

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
 
11
11
namespace Geary.String {
12
12
 
 
13
public const char EOS = '\0';
 
14
 
13
15
public bool is_empty_or_whitespace(string? str) {
14
 
    return (str == null || str[0] == 0 || str.strip()[0] == 0);
 
16
    return (str == null || str[0] == EOS || str.strip()[0] == EOS);
15
17
}
16
18
 
17
19
public inline bool is_empty(string? str) {
18
 
    return (str == null || str[0] == 0);
 
20
    return (str == null || str[0] == EOS);
19
21
}
20
22
 
21
23
public int ascii_cmp(string a, string b) {
30
32
        if (diff != 0)
31
33
            return diff;
32
34
        
33
 
        if (*aptr == '\0')
 
35
        if (*aptr == EOS)
34
36
            return 0;
35
37
        
36
38
        aptr++;
58
60
    return str_equal(((string *) a)->down(), ((string *) b)->down());
59
61
}
60
62
 
 
63
public bool equals_ci(string a, string b) {
 
64
    return a.down() == b.down();
 
65
}
 
66
 
61
67
public bool nullable_stri_equal(void *a, void *b) {
62
68
    if (a == null)
63
69
        return (b == null);