Code Monkey home page Code Monkey logo

Comments (2)

azihassan avatar azihassan commented on September 26, 2024

This feature will require applying some significant changes in the clipboard module. Files that are queued for copying are currently written to a text file. With the introduction of a new mode, the clipboard format has to somehow differentiate between copying and cutting. Several approaches come to mind :

Using two text files, one for copying and one for cutting

Pros :

  • Easier implementation since it's just plain text

Cons :

  • Juggling with two different clipboards can prove to be problematic

Using a format that would allow me to specify whether files are queued for copying or moving (CSV, XML, JSON, etc.)

Pros :

  • Are available in the standard library (except for XML, which is deprecated)

Cons :

  • Requires a parser for the chosen format
  • I think lookups are going to be linear and/or might require loading the entire clipboard into RAM

Using a SQLite database

Pros :

  • It seems like it would be the right tool for the job
  • Is probably optimized for this sort of thing

Cons :

  • Harder to implement
  • Will probably need to use an external library

from ctrl.

azihassan avatar azihassan commented on September 26, 2024

Alright so in the end I went with the last option, an SQLite database. It's probably overkill for such a simple program, but oh well.

Impacts of this choice :

  • Lookup member functions are no longer const because they call SQLite's prepare function which isn't const
  • An additional external dependency
  • Increased build times

from ctrl.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.