Comments (2)
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.
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'sprepare
function which isn't const - An additional external dependency
- Increased build times
from ctrl.
Related Issues (18)
- Dub-ify the project
- Rethink the executable names HOT 2
- Add a license to the project
- Binary files HOT 1
- Set up releases HOT 1
- Measure test coverage HOT 1
- Update build status badge
- Add some sort of reporting HOT 3
- The test coverage is suspiciously high
- ctrl doesn't support folders
- The sqlite package seems to be obsolete
- Permissions aren't preserved after copying a file
- ctrl -X doesn't work across drives HOT 2
- Tests should be improved HOT 3
- Copying a file that doesn't exist
- Clipboard file can not be created
- Add option to copy multiple files in one call
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ctrl.