To prosecute all felony criminal actions, irrespective of whom the arresting officer is; to prosecute all misdemeanor or infraction actions for violation of all state laws or county ordinances when the arresting or charging officer is a state or county employee; to conduct preliminary criminal examinations which may be had before magistrates; to prosecute or defend all civil actions in which the c