コード例 #1
0
ファイル: remotecontrol.cpp プロジェクト: haobug/gnote
 std::string RemoteControl::GetNoteContentsXml(const std::string& uri)
 {
   Note::Ptr note;
   note = m_manager.find_by_uri (uri);
   if (!note)
     return "";
   return note->xml_content();
 }
コード例 #2
0
ファイル: search.cpp プロジェクト: haobug/gnote
bool Search::check_note_has_match(const Note::Ptr & note,
                                  const std::vector<std::string> & encoded_words,
                                  bool match_case)
{
    std::string note_text = note->xml_content();
    if (!match_case) {
        note_text = sharp::string_to_lower(note_text);
    }

    for(std::vector<std::string>::const_iterator iter = encoded_words.begin();
            iter != encoded_words.end(); ++iter) {
        if (sharp::string_contains(note_text, *iter) ) {
            continue;
        }
        else {
            return false;
        }
    }

    return true;
}