SIMPLE_ROSETTA
Main facade class for Rosetta Code solution management.
Creation
| Feature | Signature | Description |
make | | Create with default database path. |
make_with_db | (a_path: STRING) | Create with custom database path. |
Queries
| Feature | Signature | Description |
search_solutions | (a_keyword: STRING): ARRAYED_LIST [TUPLE] | Search solutions by keyword. |
solutions_by_tier | (a_tier: INTEGER): ARRAYED_LIST [TUPLE] | Get all solutions for tier (1-4). |
get_solution_code | (a_task: STRING): detachable STRING | Get source code for task. |
solution_count | : INTEGER | Total stored solutions. |
tier_summary | : ARRAYED_LIST [TUPLE] | Count per tier. |
Wiki Format
| Feature | Signature | Description |
solution_as_wiki | (a_task: STRING): detachable STRING | Format for Rosetta Code wiki. |
Storage
| Feature | Signature | Description |
store_solution | (...) | Store a new solution. |
close | | Close database connection. |
is_open | : BOOLEAN | Is connection open? |
SOLUTION_STORE
SQLite storage for Eiffel solutions.
Features
| Feature | Signature | Description |
make | (a_db_path: STRING) | Create store with database at path. |
store_solution | (...) | Store solution with metadata. |
solution_count | : INTEGER | Number of stored solutions. |
solutions_by_tier | (a_tier: INTEGER): ARRAYED_LIST [TUPLE] | Solutions for tier. |
get_solution_code | (a_task: STRING): detachable STRING | Get source code. |
search_solutions | (a_keyword: STRING): ARRAYED_LIST [TUPLE] | Search by keyword. |
SOLUTIONS_VALIDATOR
Validates and imports solution files.
Features
| Feature | Signature | Description |
make | (a_store: SOLUTION_STORE) | Create with storage backend. |
import_solutions | (a_path: STRING) | Import .e files recursively. |
imported_count | : INTEGER | Solutions imported. |
error_count | : INTEGER | Import errors. |
Contract Patterns
All features follow Design by Contract:
search_solutions (a_keyword: STRING): ARRAYED_LIST [...]
require
valid_keyword: not a_keyword.is_empty
do
...
ensure
result_attached: Result /= Void
end
solutions_by_tier (a_tier: INTEGER): ARRAYED_LIST [...]
require
valid_tier: a_tier >= 1 and a_tier <= 4
do
...
end