~ubuntu-branches/ubuntu/gutsy/soprano/gutsy

« back to all changes in this revision

Viewing changes to soprano/statement.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2007-10-12 14:43:48 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20071012144348-yajzi51v4k23ahxf
Tags: 1.95.0~beta2-1ubuntu1
* Sync with Debian
* Add versioned build-dep on raptor

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
    return *this;
66
66
}
67
67
 
68
 
bool Statement::operator==( const Statement& other )
 
68
bool Statement::operator==( const Statement& other ) const
69
69
{
70
70
    return ( d->subject == other.subject() &&
71
71
             d->predicate == other.predicate() &&
73
73
             d->context == other.context() );
74
74
}
75
75
 
76
 
bool Statement::operator!=( const Statement& other )
 
76
bool Statement::operator!=( const Statement& other ) const
77
77
{
78
78
    return ( d->subject != other.subject() ||
79
79
             d->predicate != other.predicate() ||
81
81
             d->context != other.context() );
82
82
}
83
83
 
84
 
bool Soprano::Statement::matches( const Statement& other ) const
85
 
{
86
 
    return ( d->subject.matches( other.subject() ) &&
87
 
             d->predicate.matches( other.predicate() ) &&
88
 
             d->object.matches( other.object() ) &&
89
 
             d->context.matches( other.context() ) );
90
 
}
91
 
 
92
84
void Statement::setSubject( const Node &subject )
93
85
{
94
86
    // d->detach() is called automatically
145
137
}
146
138
 
147
139
 
148
 
bool Soprano::Statement::operator==( const Statement& other ) const
149
 
{
150
 
    return ( d->subject == other.d->subject &&
151
 
             d->predicate == other.d->predicate &&
152
 
             d->object == other.d->object &&
153
 
             d->context == other.d->context );
154
 
}
155
 
 
156
 
 
157
140
QDebug operator<<( QDebug s, const Soprano::Statement& sm )
158
141
{
159
142
    s.nospace() << "[" << sm.subject() << "," << sm.predicate() << "," << sm.object() << "," << sm.context() << "]";
160
 
    return s.space();
 
143
    return s;
161
144
}
162
145
 
163
146