예제 #1
0
 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;
}