save_input_approver(3)

πŸ“¦ version 1.6, in fedora 43, fedora 44

✨ save_input_approver ✨

okay bestie, gather round β€” this is a page from the gstream manual, section 3. Yes, the whole library functions section. Very demure, very coder of us. πŸ’…


🌸 NAME 🌸

save_input_approver β€” the little function that tucks your current input approver away somewhere safe so you can get it back later πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <gstream.h>

void save_input_approver();

that's it. that's the whole thing. no args, no return value, just vibes and a backup. ✨


πŸ’– DESCRIPTION πŸ’–

so here's the tea, bestie. πŸ“

The input approver system has one super common move: you wanna temporarily swap in your own homemade approver, run an input, and then put everything back exactly how it was. main character energy, honestly. Because of that, gstream ships a lil duo of functions to hold your hand through it:

  • save_input_approver
  • restore_input_approver

a matching set. iconic. no notes. πŸ‘‘

And what does the saving one do? It backs up the approver you're currently using, so you can keep on using it without losing track of it. Like screenshotting your settings before you go feral in the config. πŸ™ˆ

here's the whole glow-up in code form:

gs.save_input_approver();
gs >> my_string;           // uses still default approver
gs.set_input_approver(ia_my_own);
gs >> my_string;           // uses ia_my_own approver
gs.restore_input_approver();
gs >> my_string;           // uses default approver again

read it again, it's literally a little story: save β†’ still the default approver β†’ swap in ia_my_own β†’ now it's using ia_my_own β†’ restore β†’ default approver is back, baby. πŸ”₯

heads up: saving only backs up the approver β€” it doesn't change anything by itself. The actual swapping happens in set_input_approver, and the getting-it-back happens in restore_input_approver. πŸ’€

🌈 SEE ALSO 🌈


and that's the page!! this whole thing lives in the gstream manual, version 1.6, and yeah β€” it's filed under save_input_approver(3). slay, go back up your approvers responsibly πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from