◐ Shell
clean mode source ↗

std::basic_ostream — cppreference.com

De cppreference.com

<tbody> </tbody>

Déclaré dans l'en-tête

<ostream>

template< class CharT, class Traits = std::char_traits<CharT> > class basic_ostream : virtual public std::basic_ios<CharT, Traits>

Le modèle de classe basic_ostream fournit un support pour les opérations de haut de niveau de sortie sur les flux de caractères. Les opérations prises en charge incluent une sortie formatée (par exemple des valeurs entières) et de sortie non formatée (par exemple, des caractères bruts et des tableaux de caractères). Cette fonctionnalité est implémentée en termes d'interface fournie par la classe basic_streambuf, accessibles via la classe de base basic_ios. Dans les implémentations typiques, basic_ostream n'a pas non héritées des membres de données .

Original:

The class template basic_ostream provides support for high level output operations on character streams. The supported operations include formatted output (e.g. integer values) and unformatted output (e.g. raw characters and character arrays). This functionality is implemented in terms of the interface provided by the basic_streambuf class, accessed through the basic_ios base class. In typical implementations, basic_ostream has no non-inherited data members.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

cpp/io/ios basecpp/io/basic ios

Inheritance diagram

Deux spécialisations pour les types de caractères communs sont également définis:

Original:

Two specializations for common character types are also defined:

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Defined in header <ostream>

Type d'

Original:

Type

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Definition
ostream basic_ostream<char>
wostream basic_ostream<wchar_t>

Les objets globaux

Six mondiaux objets basic_ostream sont fournis par la bibliothèque standard .

Original:

Six global basic_ostream objects are provided by the standard library.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Defined in header <iostream>

écrit à la norme C stdout
(

objet global

Original:

global object

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

) flux de sortie

Original:

writes to the standard C output stream stdout
(

objet global

Original:

global object

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

)

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]

écrit dans le flux d'erreur standard C stderr, unbuffered
(

objet global

Original:

global object

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

)

Original:

writes to the standard C error stream stderr, unbuffered
(

objet global

Original:

global object

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

)

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]

écrit à la norme C stderr
(

objet global

Original:

global object

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

) flux d'erreur

Original:

writes to the standard C error stream stderr
(

objet global

Original:

global object

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

)

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]

Types de membres

Type du membre Définition
char_type CharT[edit]
traits_type Traits[edit]
int_type Traits::int_type[edit]
pos_type Traits::pos_type[edit]
off_type Traits::off_type[edit]

Fonctions membres

Construit l'objet

Original:

constructs the object

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique) [edit]

[

virtuel

Original:

virtual

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

]

Détruit l'objet

Original:

destructs the object

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(function membre virtuelle publique) [edit]

(C++11)

remplace l'objet tampon

Original:

replaces the buffer object

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre protégée) [edit]

Sortie formatée

Original:

Formatted output

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

inserts en forme des données

Original:

inserts formatted data

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique) [edit]

Emission non formatée

Original:

Unformatted output

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

insère un caractère

Original:

inserts a character

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique) [edit]

blocs inserts de caractères

Original:

inserts blocks of characters

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique) [edit]

Positionnement

Original:

Positioning

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

renvoie l'indicateur de position de sortie

Original:

returns the output position indicator

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique) [edit]

définit l'indicateur de position de sortie

Original:

sets the output position indicator

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique) [edit]

Divers

Original:

Miscellaneous

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

synchronise avec le dispositif de stockage sous-jacent

Original:

synchronizes with the underlying storage device

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique) [edit]

(C++11)

objets swaps de cours d'eau, sauf pour le tampon associé

Original:

swaps stream objects, except for the associated buffer

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre protégée) [edit]

Classes de membres

met en oeuvre la logique de base pour la préparation du courant pour des opérations de sortie

Original:

implements basic logic for preparation of the stream for output operations

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(classe membre publique) [edit]

Fonctions annexes

Inherited from std::basic_ios

Member types

Type du membre Définition
char_type CharT
traits_type Traits
int_type Traits::int_type
pos_type Traits::pos_type
off_type Traits::off_type

Fonctions de l'État

Original:

State functions

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

vérifie si aucune erreur n'est survenue dire opérations E / S sont disponibles

Original:

checks if no error has occurred i.e. I/O operations are available

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique de std::basic_ios) [edit]

vérifie si fin de fichier a été atteinte

Original:

checks if end-of-file has been reached

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique de std::basic_ios) [edit]

vérifie si une erreur irrécupérable s'est produite

Original:

checks if a recoverable error has occurred

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique de std::basic_ios) [edit]

vérifie si une erreur irrécupérable s'est produite

Original:

checks if a non-recoverable error has occurred

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique de std::basic_ios) [edit]

vérifie si une erreur s'est produite (synonyme de

fail()

)

Original:

checks if an error has occurred (synonym of

fail()

)

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique de std::basic_ios) [edit]

(avant C++11)
(depuis C++11)

vérifie si aucune erreur ne s'est produite (synonyme de !fail())

Original:

checks if no error has occurred (synonym of !fail())

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique de std::basic_ios) [edit]

retourne drapeaux nationaux

Original:

returns state flags

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique de std::basic_ios) [edit]

définit des indicateurs d'état

Original:

sets state flags

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique de std::basic_ios) [edit]

efface les indicateurs d'erreur et eof

Original:

clears error and eof flags

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique de std::basic_ios) [edit]

Mise en forme

Original:

Formatting

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

copies de formater l'information

Original:

copies formatting information

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique de std::basic_ios) [edit]

gère le caractère de remplissage

Original:

manages the fill character

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique de std::basic_ios) [edit]

Divers

Original:

Miscellaneous

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

gère masque d'exception

Original:

manages exception mask

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique de std::basic_ios) [edit]

définit les paramètres régionaux

Original:

sets the locale

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique de std::basic_ios) [edit]

gère tampon de flux associé

Original:

manages associated stream buffer

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique de std::basic_ios) [edit]

gère flux liés

Original:

manages tied stream

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique de std::basic_ios) [edit]

rétrécit caractères

Original:

narrows characters

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique de std::basic_ios) [edit]
widens characters
(fonction membre publique de std::basic_ios) [edit]

Inherited from std::ios_base

Member functions

Mise en forme

Original:

Formatting

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

gère indicateurs de format

Original:

manages format flags

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique de std::ios_base) [edit]

active l'indicateur de format spécifique

Original:

sets specific format flag

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique de std::ios_base) [edit]
clears specific format flag
(fonction membre publique de std::ios_base) [edit]

gère précision décimale des opérations en virgule flottante

Original:

manages decimal precision of floating point operations

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique de std::ios_base) [edit]
manages field width
(fonction membre publique de std::ios_base) [edit]

Locales

Original:

Locales

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

fixe locale

Original:

sets locale

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique de std::ios_base) [edit]

retourne localisation en cours

Original:

returns current locale

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique de std::ios_base) [edit]

Interne gamme extensible

Original:

Internal extensible array

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[

statique

Original:

static

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

]

renvoie un entier ensemble du programme unique qui est sûr à utiliser comme indice de motpasse () et iword ()

Original:

returns a program-wide unique integer that is safe to use as index to pword() and iword()

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique statique de std::ios_base) [edit]

redimensionne le stockage privé et le cas échéant un accès à l'élément de long à l'index donné

Original:

resizes the private storage if necessary and access to the long element at the given index

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique de std::ios_base) [edit]

redimensionne le stockage privé et le cas échéant un accès à l'élément de void* à l'index donné

Original:

resizes the private storage if necessary and access to the void* element at the given index

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique de std::ios_base) [edit]

Divers

Original:

Miscellaneous

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

enregistre fonction de rappel d'événement

Original:

registers event callback function

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique de std::ios_base) [edit]

[

statique

Original:

static

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

]

définit si le C + + et C des bibliothèques d'entrées-sorties sont interopérables

Original:

sets whether C++ and C IO libraries are interoperable

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique statique de std::ios_base) [edit]

Classes de membres

Original:

Member classes

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

exception ruisseau

Original:

stream exception

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(classe membre publique de std::ios_base) [edit]

initialise les objets de flux standard

Original:

initializes standard stream objects

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(classe membre publique de std::ios_base) [edit]

Types de membres et de constantes

Original:

Member types and constants

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Type d'

Original:

Type

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Explanation

type de mode de flux ouvert Les constantes suivantes sont également définis:

Original:

stream open mode type The following constants are also defined:

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Constante

Original:

Constant

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Explanation[edit]
app

demander à l'extrémité du flux avant chaque écriture

Original:

seek to the end of stream before each write

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]
binary

ouvrir en mode binaire

Original:

open in binary mode

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]
in

ouvrir en lecture

Original:

open for reading

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]
out

ouvrir en écriture

Original:

open for writing

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]
trunc

jeter le contenu du courant lors de l'ouverture

Original:

discard the contents of the stream when opening

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]
ate

demander à l'extrémité du flux immédiatement après ouverture

Original:

seek to the end of stream immediately after open

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]

(typedef) [edit]

la mise en forme des drapeaux de type Les constantes suivantes sont également définis:

Original:

formatting flags type The following constants are also defined:

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Constante

Original:

Constant

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Explanation[edit]
dec

utiliser la base décimale pour l'entier I / O

Original:

use decimal base for integer I/O

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]
oct

utiliser octal de base pour l'entier I / O

Original:

use octal base for integer I/O

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]
hex

utiliser la base hexadécimale entier I / O

Original:

use hexadecimal base for integer I/O

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]
basefield

dec|oct|hex|0. Utile pour masquer les opérations

Original:

dec|oct|hex|0. Useful for masking operations

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]
left

réglage gauche (ajoute des caractères de remplissage à droite)

Original:

left adjustment (adds fill characters to the right)

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]
right

réglage de droite (ajoute des caractères de remplissage à gauche)

Original:

right adjustment (adds fill characters to the left)

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]
internal

ajustement interne (ajoute des caractères de remplissage au point interne désignée)

Original:

internal adjustment (adds fill characters to the internal designated point)

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]
adjustfield

left|right|internal. Utile pour masquer les opérations

Original:

left|right|internal. Useful for masking operations

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]
scientific

générer des types virgule flottante en utilisant la notation scientifique, ou une notation hexadécimale s'il est combiné avec fixe

Original:

generate floating point types using scientific notation, or hex notation if combined with fixed

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]
fixed

générer des types virgule flottante en utilisant la notation fixe ou notation hexadécimale si elle est combinée avec les scientifiques

Original:

generate floating point types using fixed notation, or hex notation if combined with scientific

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]
floatfield

scientific|fixed|(scientific|fixed)|0. Utile pour masquer les opérations

Original:

scientific|fixed|(scientific|fixed)|0. Useful for masking operations

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]
boolalpha

insérer et d'extraire de type bool au format alphanumérique

Original:

insert and extract bool type in alphanumeric format

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]
showbase

générer un préfixe indiquant la base numérique pour la sortie de nombre entier, nécessitent l'indicateur monnaie monétaire I / O

Original:

generate a prefix indicating the numeric base for integer output, require the currency indicator in monetary I/O

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]
showpoint

générer un caractère point décimal sans condition pour la sortie de nombre à virgule flottante

Original:

generate a decimal-point character unconditionally for floating-point number output

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]
showpos

générer un caractère + pour les non-négative de sortie numérique

Original:

generate a + character for non-negative numeric output

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]
skipws

sauter espaces en tête avant les opérations d'entrée de certains

Original:

skip leading whitespace before certain input operations

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]
unitbuf

rincer la sortie après chaque opération de sortie

Original:

flush the output after each output operation

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]
uppercase

remplacer certaines lettres minuscules avec leurs uppercase
equivalents dans certaines opérations de sortie de sortie

Original:

replace certain lowercase letters with their uppercase
equivalents in certain output output operations

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]

(typedef) [edit]

état du type de flux Les constantes suivantes sont également définis:

Original:

state of the stream type The following constants are also defined:

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Constante

Original:

Constant

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Explanation[edit]
goodbit

pas d'erreur

Original:

no error

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]
badbit

erreur de flux irrécupérables

Original:

irrecoverable stream error

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]
failbit

d'entrée / sortie de l'opération a échoué (erreur de formatage ou d'extraction)

Original:

input/output operation failed (formatting or extraction error)

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]
eofbit

séquence d'entrée associé a atteint la fin de fichier

Original:

associated input sequence has reached end-of-file

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]

(typedef) [edit]

cherchant type de direction Les constantes suivantes sont également définis:

Original:

seeking direction type The following constants are also defined:

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Constante

Original:

Constant

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Explanation[edit]
beg

le début d'un flux

Original:

the beginning of a stream

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]
end

la fin d'un cours d'eau

Original:

the ending of a stream

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]
cur

la position actuelle de l'indicateur de position courant

Original:

the current position of stream position indicator

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[edit]

(typedef) [edit]

spécifie le type d'événement

Original:

specifies event type

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(enum) [edit]

callback type de fonction

Original:

callback function type

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(typedef) [edit]