presage.h | presage.h | |||
---|---|---|---|---|
skipping to change at line 92 | skipping to change at line 92 | |||
presage_error_code_t presage_save_config (presage_t prsg); | presage_error_code_t presage_save_config (presage_t prsg); | |||
/* | /* | |||
* Presage C API ends here | * Presage C API ends here | |||
*/ | */ | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
} | } | |||
#endif | #endif | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
#ifndef _MSC_VER | ||||
/* | ||||
* Presage C++ API starts here | ||||
*/ | ||||
#include <string> | #include <string> | |||
#include <vector> | #include <vector> | |||
#include <map> | #include <map> | |||
/* Forward declarations, not part of presage C++ API */ | /* Forward declarations, not part of presage C++ API */ | |||
class Configuration; | class Configuration; | |||
class ProfileManager; | class ProfileManager; | |||
class Profile; | class Profile; | |||
class ContextTracker; | class ContextTracker; | |||
class PredictorRegistry; | class PredictorRegistry; | |||
class PredictorActivator; | class PredictorActivator; | |||
class Selector; | class Selector; | |||
/* | ||||
* Presage C++ API starts here | ||||
*/ | ||||
/** \brief Presage, the intelligent predictive text entry platform. | /** \brief Presage, the intelligent predictive text entry platform. | |||
*/ | */ | |||
class Presage { | class Presage { | |||
public: | public: | |||
/** Creates and initializes presage. | /** Creates and initializes presage. | |||
* | * | |||
* \param callback is a user-supplied implementation of PresageCallback interface | * \param callback is a user-supplied implementation of PresageCallback interface | |||
* | * | |||
* Presage does not take ownership of the callback object. | * Presage does not take ownership of the callback object. | |||
*/ | */ | |||
skipping to change at line 254 | skipping to change at line 254 | |||
PredictorRegistry* predictorRegistry; | PredictorRegistry* predictorRegistry; | |||
ContextTracker* contextTracker; | ContextTracker* contextTracker; | |||
PredictorActivator* predictorActivator; | PredictorActivator* predictorActivator; | |||
Selector* selector; | Selector* selector; | |||
}; | }; | |||
/* | /* | |||
* Presage C++ API ends here | * Presage C++ API ends here | |||
*/ | */ | |||
#endif /* _MSC_VER */ | ||||
#endif /* __cplusplus */ | #endif /* __cplusplus */ | |||
/** \mainpage | /** \mainpage | |||
\section intro_section Introduction | \section intro_section Introduction | |||
Presage is an intelligent predictive text entry | Presage is an intelligent predictive text entry | |||
platform. Presage exploits <a | platform. Presage exploits <a | |||
href="http://en.wikipedia.org/wiki/Redundancy_%28information_theory%29" >redundant | href="http://en.wikipedia.org/wiki/Redundancy_%28information_theory%29" >redundant | |||
information</a> embedded in natural languages to generate | information</a> embedded in natural languages to generate | |||
End of changes. 3 change blocks. | ||||
4 lines changed or deleted | 5 lines changed or added | |||
presageCallback.h | presageCallback.h | |||
---|---|---|---|---|
skipping to change at line 39 | skipping to change at line 39 | |||
#endif | #endif | |||
typedef const char* (*_presage_callback_get_past_stream) (void*); | typedef const char* (*_presage_callback_get_past_stream) (void*); | |||
typedef const char* (*_presage_callback_get_future_stream) (void*); | typedef const char* (*_presage_callback_get_future_stream) (void*); | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
} | } | |||
#endif | #endif | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
#ifndef _MSC_VER | ||||
#include <string> | #include <string> | |||
#include <sstream> | #include <sstream> | |||
/** Abstract callback object used to retrieve context from user application . | /** Abstract callback object used to retrieve context from user application . | |||
* | * | |||
* A concrete callback implementation must implement the | * A concrete callback implementation must implement the | |||
* getPastStream() and getFutureStream() method which are responsible | * getPastStream() and getFutureStream() method which are responsible | |||
* for retrieving the context from the user text buffer. | * for retrieving the context from the user text buffer. | |||
* | * | |||
skipping to change at line 114 | skipping to change at line 115 | |||
m_stream.erase(m_stream.end() - 1); | m_stream.erase(m_stream.end() - 1); | |||
} else { | } else { | |||
m_stream.push_back(character); | m_stream.push_back(character); | |||
} | } | |||
} | } | |||
std::string m_stream; | std::string m_stream; | |||
const std::string m_empty; | const std::string m_empty; | |||
}; | }; | |||
#endif /* _MSC_VER */ | ||||
#endif /* _cplusplus */ | #endif /* _cplusplus */ | |||
#endif /* PRESAGE_CALLBACK */ | #endif /* PRESAGE_CALLBACK */ | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 2 lines changed or added | |||
presageException.h | presageException.h | |||
---|---|---|---|---|
skipping to change at line 50 | skipping to change at line 50 | |||
PRESAGE_INIT_PREDICTOR_ERROR, | PRESAGE_INIT_PREDICTOR_ERROR, | |||
PRESAGE_SQLITE_OPEN_DATABASE_ERROR, | PRESAGE_SQLITE_OPEN_DATABASE_ERROR, | |||
PRESAGE_SQLITE_EXECUTE_SQL_ERROR | PRESAGE_SQLITE_EXECUTE_SQL_ERROR | |||
} presage_error_code_t; | } presage_error_code_t; | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
} | } | |||
#endif | #endif | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
#ifndef _MSC_VER | ||||
#include <exception> | #include <exception> | |||
#include <string> | #include <string> | |||
/** When thrown, provides information about an error that has occurred with in presage. | /** When thrown, provides information about an error that has occurred with in presage. | |||
* | * | |||
* If an error occurs within presage, an exception is thrown, and | * If an error occurs within presage, an exception is thrown, and | |||
* this is the object that encapsulates the details of the problem. | * this is the object that encapsulates the details of the problem. | |||
* | * | |||
* Application using presage should always ensure that exceptions | * Application using presage should always ensure that exceptions | |||
skipping to change at line 94 | skipping to change at line 95 | |||
{ | { | |||
return m_code; | return m_code; | |||
} | } | |||
private: | private: | |||
std::string m_details; | std::string m_details; | |||
presage_error_code_t m_code; | presage_error_code_t m_code; | |||
}; | }; | |||
#endif /* _MSC_VER */ | ||||
#endif /* __cplusplus */ | #endif /* __cplusplus */ | |||
#endif /* PRESAGE_EXCEPTION */ | #endif /* PRESAGE_EXCEPTION */ | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 2 lines changed or added | |||