Пример #1
0
void CommandOptions::storeOptionsFile(void)
{
    wxString str;
    // open the file
    wxFileOutputStream ostrm(L"launch.sh");
    wxTextOutputStream text(ostrm, wxEOL_NATIVE, wxConvUTF8 );
    if (!ostrm.IsOk()) {
        return;
    }
    text.WriteString(L"#!/bin/sh\n");
    text.WriteString(storedCommandLine);
    text.Flush();
}
Пример #2
0
int main()
{
    // Initialize the library

    DwInitialize();

    // Get a buffer of data from a text file

    DwString buffer = "";
    DwString line;
    ifstream istrm("exampl01.txt");
    while (DwTrue) {
        getline(istrm, line);
        if (istrm.eof()) {
            break;
        }
        buffer += line + DW_EOL;
    }
    istrm.close();

    // Create a message

    BasicMessage msg;

    // Create MIME-Version and Message-id header fields

    msg.SetAutomaticFields();

    // Set header fields

    msg.SetDate(time(NULL));
    msg.SetTypeStr("Text");
    msg.SetSubtypeStr("Plain");
    msg.SetCteStr("7bit");
    msg.SetFrom("Emily Postnews <*****@*****.**>");
    msg.SetTo("verbose@noisy");
    msg.SetCc("forgetful@myvax");
    msg.SetBcc("*****@*****.**");
    msg.SetSubject("Re: How long should my signature be?");

    // Set body

    msg.SetBody(buffer);

    // Write it to a file
	
    ofstream ostrm("exampl01.out");
    ostrm << msg.AsString();

    return 0;
}
Пример #3
0
int main()
{
    // Initialize the library

    DwInitialize();

    // Create a MessageWithAttachements

    MessageWithAttachments msg;

    // Create MIME-Version and Message-id header fields

    msg.SetAutomaticFields();

    // Set header fields

    DwUint32 t = (DwUint32) time(NULL);
    msg.SetDate(t);
    msg.SetFrom("Emily Postnews <*****@*****.**>");
    msg.SetTo("verbose@noisy");
    msg.SetCc("forgetful@myvax");
    msg.SetBcc("*****@*****.**");
    msg.SetSubject("Re: How long should my signature be?");

    // Add text
    
    DwString text = "Read the attached files\n";
    msg.SetText(text);

    // Add 7bit attachment

    msg.Attach7bitFile("exampl05.txt");

    // Add 8bit attachment

    msg.Attach8bitFile("exampl05.txt");

    // Add binary attachment

    msg.AttachBinaryFile("exampl05.txt");

    // Write it to a file

    ofstream ostrm("exampl05.out");
    ostrm << msg.AsString();

    return 0;
}