FBB::mlm(3bobcat)

✨ FBB::mlm β€” the OFoldStream left-margin manipulator ✨

okay bestie, sit down, hydrate πŸ’– this is a page from the bobcat manual (section 3bobcat), and it's about a tiny little manipulator with main character energy.


🌸 NAME 🌸

FBB::mlm β€” a manipulator that changes the left margins of OFoldStream objects πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <bobcat/ofoldstream> or
#include <bobcat/ofoldbuf>
Linking option: -lbobcat

like. that's it. that's the whole synopsis. slay ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

So the mlm class is a manipulator, and you insert it into OFoldStream objects to nudge the stream's left margin by however much you ask for. 🫢

Important bit: your request can never end up giving you a negative left margin. If the arithmetic of your request would produce a negative value, then left margin 0 gets used β€” silently. no drama, no error, it just clamps to zero and moves on. it's giving graceful πŸ’€

Depending on the tab-setting of the OFoldStream, the value you insert means either the number of blank space characters or the number of tab-characters that get added to the left margin. iykyk 🌈

Now β€” the timing. ⏰ Your request gets processed at the next newline character or std::flush or std::endl manipulator that's inserted into the stream. But wait, there's a little plot twist: if a line is still empty once an mlm object and a flush manipulator have been inserted into the stream, then the new left margin becomes effective at the next word inserted into that line β€” check the example section below for the receipts πŸ‘€

⚠️ and here's the vibe check that can go wrong: a bad_cast exception gets thrown when the manipulator is inserted into an ostream that is not using an OFoldBuf buffer. not me getting caught slipping πŸ™ˆ

πŸ’œ NAMESPACE πŸ’œ

FBB

All constructors, members, operators and manipulators mentioned in this man-page are defined in the namespace FBB. periodt ✨


🧚 INHERITS FROM 🧚

-

(yep β€” nothing. no inheritance. it's independent. it doesn't need a parent, it's built different πŸ‘‘)


⭐ CONSTRUCTOR ⭐

  • mlm(int addValue) β€” makes your manipulator, holding the amount to add to the left margin ✨

Copy and move constructors (and assignment operators) are available. so yes bestie, you can copy it, move it, assign it, the whole buffet πŸ“


πŸ’… MEMBER FUNCTIONS πŸ’…

  • std::ostream &modify(std::ostream &out) const β€” this one is normally not directly called from user-programs. instead, the insertion operator calls it for you when you insert the mlm manipulator. it's the backstage crew, not the main act 🎭

🌟 EXAMPLE 🌟

okay here's the whole thing, verbatim, no cap:

#include <iostream>
#include <bobcat/ofoldstream>

using namespace std;
using namespace FBB;

int main()
{
    OFoldStream out(cout, 0, 80);
    out << "hello world (left margin is 0)" << mlm(4) << "\n"
           "this uses a 4 character wide left margin\n" <<
            mlm(-10) << flush <<
            "left margin -6 changed to 0, active on this line\n";
}

see that mlm(-10) after the margin was 4? that's -6 arithmetic, which would be negative, so it silently becomes 0 and kicks in on that line. iconic behaviour honestly 😭


πŸ“ FILES πŸ“

  • bobcat/mlm β€” defines the class interface

🌈 SEE ALSO 🌈

bobcat(7), manipulators(3bobcat), lm(3bobcat), ofoldstream(3bobcat)

go read those too, they're all in the same friend group 🫢


πŸ’€ BUGS πŸ’€

None Reported.

(which is honestly the flex of the century ✨)


πŸ‘‘ BOBCAT PROJECT FILES πŸ‘‘

Debian Bobcat project files:

  • libbobcat6: debian package containing the shared library, changelog and copyright note;
  • libbobcat-dev: debian package containing the static library, headers, manual pages, and developer info;

🌸 BOBCAT 🌸

Bobcat is an acronym of `Brokken’s Own Base Classes And Templates’.

(not me thinking that's kind of a serve πŸ’…)


This is free software, distributed under the terms of the GNU General Public License (GPL).

free as in freedom, bestie. share it, love it, keep the license 🫢


✨ AUTHOR ✨

Frank B. Brokken (f.b.brokken@rug.nl).


and that's the whole page, no skips, nothing left out πŸ’œ this was libbobcat-dev_6.15.01, dated 2005-2026, and it's the FBB::mlm(3bobcat) page β€” go forth and manipulate your margins responsibly, mwah πŸŽ€βœ¨

πŸ“¦ where this page comes from