simple_rosetta

API Reference

SIMPLE_ROSETTA

Main facade class for Rosetta Code solution management.

Creation

FeatureSignatureDescription
makeCreate with default database path.
make_with_db(a_path: STRING)Create with custom database path.

Queries

FeatureSignatureDescription
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 STRINGGet source code for task.
solution_count: INTEGERTotal stored solutions.
tier_summary: ARRAYED_LIST [TUPLE]Count per tier.

Wiki Format

FeatureSignatureDescription
solution_as_wiki(a_task: STRING): detachable STRINGFormat for Rosetta Code wiki.

Storage

FeatureSignatureDescription
store_solution(...)Store a new solution.
closeClose database connection.
is_open: BOOLEANIs connection open?

SOLUTION_STORE

SQLite storage for Eiffel solutions.

Features

FeatureSignatureDescription
make(a_db_path: STRING)Create store with database at path.
store_solution(...)Store solution with metadata.
solution_count: INTEGERNumber of stored solutions.
solutions_by_tier(a_tier: INTEGER): ARRAYED_LIST [TUPLE]Solutions for tier.
get_solution_code(a_task: STRING): detachable STRINGGet source code.
search_solutions(a_keyword: STRING): ARRAYED_LIST [TUPLE]Search by keyword.

SOLUTIONS_VALIDATOR

Validates and imports solution files.

Features

FeatureSignatureDescription
make(a_store: SOLUTION_STORE)Create with storage backend.
import_solutions(a_path: STRING)Import .e files recursively.
imported_count: INTEGERSolutions imported.
error_count: INTEGERImport 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